w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
  Home » IOS » Page 4
MMDrawerController having slider on each View Controller
you can cancel panning using below method. put that method in viewWillAppear To allow gesture add this in viewWillAppear [self.mm_drawerController setOpenDrawerGestureModeMask:MMOpenDrawerGestureModeAll]; when you push any view cancel gesture using below code. [self.mm_drawerController setOpenDrawerGestureModeMask:MMOpenDrawerGestureModeNone];

Categories : IOS

-[__NSCFNumber row]: unrecognized selector sent to instance
You have a line that says: tableView.deleteRowsAtIndexPaths([indexPath.row], withRowAnimation: .Fade) That passes an array with a row number, not an NSIndexPath. I believe you meant: tableView.deleteRowsAtIndexPaths([indexPath], withRowAnimation: .Fade)

Categories : IOS

Core Data: A clever way to implement Add/Edit functionality
It seems to me that your problem is maintaining a connection to a single NSManagedObjectContext when instead what you really want is to establish a tree. The construction of a context is fairly cheap so you should be creating a context per ViewController. So when you show the addEdit controller you can simply create it with a new context: NSManagedObjectContext *context = [[NSManagedObjectContex

Categories : IOS

"Assign to contact" in UIActivityViewController not working...!
Look at this excellent link from NSHipster. http://nshipster.com/uiactivityviewcontroller/ This gives you deep dive into UIActivityViewController.

Categories : IOS

How to Handle All gestures
Firstly i will say your question was little confusing and we can easily add multiple UITapGestures on a singleView without any prob. The OS automatically detects which gestures you are doing. There are many tutorials for that. Look at these links, if you still can find any solution, tell me may be i can try a code piece for u. Link 1 Link 2 and lastly Link 3

Categories : IOS

What navigation strategy to choose for iOS project?
The answer depends entirely on the way that you expect the users to navigate from one screen to the other: If end-users should be able to get from any screen to any other screen, use tab bar controller - UITabBarController will hold the other four views, and present a tab bar at the bottom. If you do not want the tab bar, you can hide it. If end-users on each view have two choices of view contro

Categories : IOS

How to navigate to some other View Controller when Navigation Controller back button is pressed?
You cann't back to a new ViewController, you can push a new ViewController, in your code change this: [self.navigationController pushViewController:buslist_VC animated:YES]; But keep in mind, you are putting this new viewController inside the other (where you are created a newBackButton), and the default back button come back to this. If you want to come back to the root use this: [self.n

Categories : IOS

stringForKey Crashes App
You are not calling synchronize() after setting the object: let userDefaults = NSUserDefaults.standardUserDefaults() userDefaults.setObject(itemSelected, forKey: "colourChosen") userDefaults.synchronize() ^^^^ Without that, no change is immediately saved. That might be the cause. synchronize must be invoked every time you make changes to the user defaults, and you want to immediat

Categories : IOS

How to implement native app login in ios?
Add code in Appdelegate.m file #import <FacebookSDK/FacebookSDK.h> - (void)applicationDidBecomeActive:(UIApplication *)application { [FBAppEvents activateApp]; } - (BOOL)application:(UIApplication *)application openURL:(NSURL *)urlsourceApplication:(NSString *)sourceApplication annotation:(id)annotation { // attempt to extract a token from the url return [FBAppCall handleOpenUR

Categories : IOS

Make Pan gesture require all 4 swipe gestures to fail
First, Take a brief look at this link If I get u right, u want pan gesture, so: UIPanGestureRecognizer *panGesture = [[UIPanGestureRecognizer alloc] initWithTarget:myView action:@selector(handlePan:)]; [myView addGestureRecognizer: panGesture]; Then, in handlePan: u should: - (void) handlePan:(UIPanGestureRecognize

Categories : IOS

UIPopoverController wrong UITextField height in iOS 8
I have found the issue. I had to set contentViewController.EdgesForExtendedLayout = UIRectEdge.None; within the method: public static PopoverInputController GetPopoverController(...) It seems that Apple did some more changes to the UI regarding the layout stuff as expected.

Categories : IOS

Can not pass VERY BIG (HEAVY) UIImage to another UIViewController
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info { selectedImage = [info objectForKey:UIImagePickerControllerEditedImage]; SecondViewController *vc = [SecondViewController new]; vc.selectedImage = selectedImage; [imagePickerController pushViewController:vc animated:YES]; [[NSNotificationCenter defaultCenter]

Categories : IOS

Touch ID dialog showing a second status bar
Did you see this behaviour on iPhone 6/6+ ? If yes, the way I solved it was by setting the appropriate launching xib so that iPhone 6 and 6 plus devices are using the native resolution without being scaled. (see also this question on how to do that How to enable native resolution for apps on iPhone 6 and 6 Plus? )

Categories : IOS

ios how to show modal view on clicking uimenuitem
1. readInfo.label.text is returning null. Because at this time the label in xib still not rendered. to solve this, can assign the text after pushViewController. but i would prefer to pass the text in the initWithNib method. may be create another method initWithNibName:@"xxx" text:@"Info of table cell"; store it in InfoViewController, and assign this text to it in viewDidLoad. 2. what method did

Categories : IOS

iOS / iPhone - Xcode debug area not showing object properties
It happened to me before. Turn out, it was just because a tiny mistake. So, I think you need to check two things: Whether the break points you are setting are able to discover your properties. It's all about the scope problem. To check whether you filter it out accidentally.

Categories : IOS

Script-generated files cannot be found as a project resource
You need to start using the environment variables provided by Xcode. You may as well just write the JSON directly into the output app bundle (unless you have a special reason to generate them as "source" and use Xcode to copy them, that is? If so, see below.). So I put such scripts into a sub-directory called tools, and if this script was called generate_json.sh then it's absolute path would be

Categories : IOS

Is it possible to have a custom region shape? Core Location
No it is not. As per the the documentation, currently the only region classes are CLCircularRegion, which is obviously circular, and CLBeaconRegion which is based on the proximity to an iBeacon. It is possible in the future that apple will add support for custom shaped regions but as of iOS 8, this is it. https://developer.apple.com/LIBRARY/ios/documentation/CoreLocation/Reference/CLRegion_class/

Categories : IOS

IOS callback on UIButton click
Subclassing is a way to abstract UIButton so that you can use it any places you want with the same functionality. So, you will subclass from the UIButton. Because UIButton is inherited from UIControl, you are not able to find the method to add selector in UIButton's docs. The method you are going to use to add selector is in the UIControl's docs. Using the following is to add selector to a butto

Categories : IOS

Set backgraund image position in swift
You can set imageEdgeInsets for this button. button.imageEdgeInsets = UIEdgeInsetsMake(5.0, 5.0, 0.0, 0.0) More information: https://developer.apple.com/library/ios/documentation/uikit/reference/uibutton_class/index.html#//apple_ref/occ/instp/UIButton/imageEdgeInsets

Categories : IOS

How do I improve performance for page loading on mobile?
if you have launched it online, are sure the perforamnce issues is not from your hosting provider. if you are on a shared server, may be your server are heavily overloads with contents from other users. when i first launched my application built with phonegap, i experience the same issues of server sluggishness. i have to move to another hosting server and perhaps my apps becomes super fast.

Categories : IOS

Pass Image from UITabBarController to subview (Swift)
Your tab bar controller has viewControllers property. Just iterate through it check which controller is kind of class you need. func passImage(passedImage: UIImage) { if viewControllers!.isEmpty{ return } for index in 0...viewControllers!.count{ if let controller = viewControllers[index] as? DesignerTabController controller.pickedImageView.image = passedImage } }

Categories : IOS

how to open file and append a string in it, swift
Check the reading part. The method cotentsOfFile: is a method of NSString class. And you have use it wrong way. So replace this line let text2 = String(contentsOfFile: path, encoding: NSUTF8StringEncoding, error: nil) Here you have to use NSString instead of String class. let text2 = NSString(contentsOfFile: path, encoding: NSUTF8StringEncoding, error: nil)

Categories : IOS

Document Folder for iOS 8.1 SDK
To find your app's document folder, you can simply put this into your application:didFinishLaunchingWithOptions: and you will see the path in your xcode's console window: NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSLog(@"Documents Directory: %@", [paths objectAtIndex:0]);

Categories : IOS

iOS NSDateFormatter returns null
Turns out it was my date format. This work for me. NSDateFormatter* dateFormatter = [[NSDateFormatter alloc] init]; [dateFormatter setDateFormat:@"yyyy-MM-dd'T'HH:mm:ss.ZZZZ"]; NSDate *dateFromApi = [dateFormatter dateFromString:@"0001-01-03T00:00:00+02:00"];

Categories : IOS

How do I use TouchID in landscape mode?
The App Store app does rotate the Touch ID alert but it seems to be a hack. As you rotate the device (I tried using a 6+), you see the grey alpha mask rotate along with the Touch ID alert. They may be applying a transform on the view but I have not figured out how to get to that view yet. The XCode UI inspector does not show the Touch ID dialog in your view hierarchy at runtime. Understandably a

Categories : IOS

Parse Error (Code: 102) shows up for some of my queries starting today (11/17/2014)
Parse team were able to reproduce and are investigating the issue. It's occurring for a certain number of apps. Here's the link for the bug: https://developers.facebook.com/bugs/795944720463330/

Categories : IOS

How to play video player one after another in ios?
You should be able to use this notification: https://developer.apple.com/LIBRARY/IOS/documentation/MediaPlayer/Reference/MPMoviePlayerController_Class/index.html#//apple_ref/c/data/MPMoviePlayerPlaybackDidFinishNotification And then look for this constant PlaybackEnded: https://developer.apple.com/LIBRARY/IOS/documentation/MediaPlayer/Reference/MPMoviePlayerController_Class/index.html#//apple_r

Categories : IOS

how to get keyboard height for portrait and landscape in IPhone and IPad
You can find Height of keyboard using following code. // Works in both portrait and landscape mode CGRect kbRect = [[info objectForKey:UIKeyboardFrameBeginUserInfoKey] CGRectValue]; kbRect = [self.view convertRect:kbRect toView:nil]; CGSize kbSize = kbRect.size; NSLog(@"Keyboard Height: %f Width: %f", kbSize.height, kbSize.width);

Categories : IOS

Does entities in Core Data persist their state whether save is called or not on managed context iOS?
This is how core data works. Think of the managed object context as an in-memory scratchpad for any changes you're making. When you change your objects, that change is "real" for as long as you are using that context. If you save the context, those changes are written up to the next level, which is either a parent context, or your persistent store on disk. If you destroy the context without

Categories : IOS

Listing Available networks in ios using IBM Worklight
Try this, It will give the currently connected network but not the list of available networks. Apple not supporting that. NSArray *ifs = (__bridge_transfer id)CNCopySupportedInterfaces(); NSLog(@"%s: Supported interfaces: %@", __func__, ifs); id info = nil; for (NSString *ifnam in ifs) { info = (__bridge_transfer id)CNCopyCurrentNetworkInfo((__bridge CFStringRef)ifnam);

Categories : IOS

How to crop center part of large image in iOS?
Calculate crop rect from image float imgHeight = 100.0f; //Any according to requirement float imgWidth = 100.0f; //Any according to requirement CGSize cropRect = CGSizeMake((largeImage.size.width/2)-(imgWidth/2),largeImage.size.height/2)-(imgHeight/2),imgWidth,imgHeight); Now crop it CGImageRef imageRef = CGImageCreateWithImageInRect([largeImage CGImage], cropRect); // or use the UIImage where

Categories : IOS

UIActionsheet displaying in iPhone but not in iPad
First of all, UIActionSheet existed before UIPopoverController and UIPopoverController isn't available on iPhone, so it's useful for backwards compatibility and universal apps. Also, a UIActionSheet isn't necessarily presented in a popover, specifically, if you show it from a UIBarButtonItem or UIToolbar that is already inside a popover. It is then presented in a similar fashion as on the iPhone

Categories : IOS

ScrollView issue on AutoLayout ( Xcode 6)
You should add your textfield to scrollview with "horizontal centre in container". That means how much your scrollview width is increase/decrease your textfield will remain in centre with its leading and trailing constraint constant. So it will adjust its width as per scrollview width.

Categories : IOS

How can I change the track for the freeway drive in simulator?
Hi sid Please follow this Screenshots To change Simulator debug mode To give your location longitude and latitude which you get from google maps

Categories : IOS

How to implement iAd correctly
Add the iAd Framework to your build libraries. Include this in your .h file #import <iAd/iAd.h> Include this in viewDidLoad of .m file. self.canDisplayBannerAds = YES;

Categories : IOS

Document Or cache Path Changes on every launch in iOS 8
The path to the application container or sandbox changing should be an expected condition. You should not store the absolute filesystem path to a sandbox directory; instead store the path relative to that directory, and append that to the result of NSSearchPathForDirectoriesInDomains each time.

Categories : IOS

What is wrong with this NSLocalizableString code?
The syntax of NSLocalizedString goes like the below. NSString * NSLocalizedString( NSString *key, NSString *comment ) The key should be used in your .strings file. The value of the key will be different for different languages . So when you run the key will be replaced by the value provided in the language .strings file you set. Look at this tutorial for more explanation.

Categories : IOS

Create and place a UILabel to fix my text with a dynamic height
Try this, UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 100, 35)];//set the correct width here NSString *text = @"A string of x letters of text goes here"; label.text = text; CGSize constrainedSize = CGSizeMake(label.frame.size.width , 9999); //TODO:change the font properties to yourown NSDictionary *attributesDictionary = [NSDictionary dictionaryWithObjectsAndKeys:

Categories : IOS

How to use Asihttprequest asynchronous requests server? Beginners want a detailed explanation thank you
Try this, #import <CommonCrypto/CommonDigest.h> NSString *md5(NSString *str) { const char *cStr = [str UTF8String]; unsigned char result[CC_MD5_DIGEST_LENGTH]; CC_MD5( cStr, strlen(cStr), result ); return [NSString stringWithFormat:@"%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X", result[0], result[1], result[2], result[3],

Categories : IOS




© Copyright 2018 w3hello.com Publishing Limited. All rights reserved.