w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
  Home » IOS » Page 3
Unable to create UINavigationController
You should be sure that you are created detailViewController before assign to NavControler. // You must: UIViewController *detailViewController = [[UIViewController alloc] init]; UINavigationController *navController=[[UINavigationController alloc]initWithRootViewController:detailViewController]; If you are using storyBoards, add as star viewController a UINavigationController and con

Categories : IOS

Modal transition style like in Mail app
I'm pretty sure this is your answer - Page sheet - as in UIModalPresentationPageSheet https://developer.apple.com/library/ios/documentation/userexperience/conceptual/mobilehig/Alerts.html#//apple_ref/doc/uid/TP40006556-CH14-SW3

Categories : IOS

Error handling for adbannerview effect App Store review?
This helped me: http://codewithchris.com/iad-tutorial/ Search the callbacks bannerViewDidLoadAd and didFailToReceiveAdWithError.

Categories : IOS

Set useragent in WKWebview
As noted in my comment you can use the same approach as described here: Change User Agent in UIWebView (iPhone SDK) Now if you want to get the user agent you need to have an instance of a WKWebView and evaluate this javascript on it: navigator.userAgent The problem is that if you set a custom user agent after a WKWebView has been instantiated you will always get the same user agent. To solve t

Categories : IOS

NSURLSession malloc_error
To be honest, this looks like a iOS 8.1 bug :( I used to get this error in the past, working with a non-ARC project, when I used release twice accidentally on an attribute, so it's probably the application complaining that you're trying to free a section of the heap that has no allocated memory. Since not only you're using ARC and not freeing memory directly, but also you're getting this error ran

Categories : IOS

correctly convert hex to base64
If you have a hex string that represents an image, you simply want to convert that hex string to a NSData NSString *hexadecimalString = ... NSData *data = [hexadecimalString dataFromHexadecimalString]; self.imageView.image = [UIImage imageWithData:data]; Where dataFromHexadecimalString might be defined in a NSString category like so: @implementation NSString (Hexadecimal) - (NSData *)dataFrom

Categories : IOS

return CGRect on selector causes crash
In objective-C you can not return CGRect. so you have to CGRect convert into NSValue. so you get the crash report. This is a fundamental limitation of Objective-C — a variable cannot sometimes hold an object and sometimes a primitive value. The best workaround is to return an NSNumber or NSValue object wrapping the real value you want to return.

Categories : IOS

How to create a text child without tag using GDataXml
You can creat a text without tag by using method: (id)textWithStringValue:(NSString *)value as the following: GDataXMLElement * pElement = [GDataXMLElement elementWithName:@"p"]; [pElement addChild:[GDataXMLNode textWithStringValue:@" First string child "]]; [pElement addChild:[GDataXMLNode elementWithName:@"a" stringValue:@"link"]]; [pElement addChild:[GDataXMLNode textWi

Categories : IOS

Detect when url containing local anchor tag is clicked on UIWebView?
I don't exactly follow what you're trying to do, perhaps you could clarify a bit more. In the meantime, here's how to get your UIWebView to handle every link click in the web page it has loaded. It's looking for a URL Scheme that begins with "bloodwing". If it finds it, it will stop the request. Otherwise, it will work as expected. So http://www.yahoo.com will work, and bloodwing://www.yahoo.

Categories : IOS

iOS code to dismiss a View with countdown
Putting this Code into your bubble view Controllers viewDidLoad or similar and it will dismiss itself after 30 seconds: dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(30 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ [self dismissViewControllerAnimated:YES completion:nil]; });

Categories : IOS

How to save and fetch one Object from Database in Swift?
You can do as following. //For storing only one object, func saveConfiguration (config : ConfigDao){ let entity = NSEntityDescription.entityForName("AppConfig", inManagedObjectContext:self.del.managedObjectContext!) var fetchRequest = NSFetchRequest (entityName: "AppConfig") if let fetchResults = del.managedObjectContext!.executeFetchRequest(fetchRequest, error: nil) a

Categories : IOS

Get Facebook user's page likes iOS
I got my answer and this is how I made it happen: //Page likes /* make the API call */ [FBRequestConnection startWithGraphPath:@"me/likes?limit=10" parameters:nil HTTPMethod:@"GET"

Categories : IOS

Reload UITableView Header View without blink
Hmm probably you should use this approach try to indicate when you start and end update of table view : [self.tableView beginUpdates]; [self.table reloadSections:indexSet withRowAnimation:UITableViewRowAnimationNone]; [self.tableView endUpdates];

Categories : IOS

How to split NSArray into NSDictationary by param
Pseudo code : result = new mutable dictionary for each (object in array) age = object[@"age"] if (result[age] does not exist) result[age] = new mutable array append object to result[age] Voilà.

Categories : IOS

Should I use copy or strong with arrays?
Its simple, Consider somewhere in your view controller NSArray *myArrayCopy = self.myArray Now If myArray is strong then if you change some object in myArrayCopy myArray will automatically changed. while in case of copy it would not changed as it will assign copy of myArray to myArrayCopy.

Categories : IOS

Compile time Error libxml2.dylib
try this 1-In target Build Settings, Linking -> Other Linker Flags, add -lxml2 2-In target Build Settings, Search Paths -> Header Search Paths, add $(SDKROOT)/usr/include/libxml2 3-In target Build Phases, Link Binary With Libraries, add libxml2.dylib

Categories : IOS

WMTS protocol and MapKit
No it does not natively. You can use an library called Route Me on github. It is a BSD license. https://github.com/Alpstein/route-me

Categories : IOS

PKPaymentAuthorizationViewController present as nil view controller
Did you implement these methods to check before trying to present the viewcontroller? // Determine whether this device can process payment requests. // YES if the device is generally capable of making in-app payments. // NO if the device cannot make in-app payments or if the user is restricted from authorizing payments. + (BOOL)canMakePayments; // Determine whether this device can process paymen

Categories : IOS

Instagram API Implementation failed in iOS
The error is pretty explicit: the webview could not load the URL ige99d3bcd754b49b6ad543375c4a3edaa://authorize#access_token=1558091028.e99d3bc.889f10ef7ff64fc8938ed6de9d8978f8. There are fundamental problems with how you're attempting to construct and parse URLs. Take a moment to revisit the documentation for NSURL and NSURLComponents.

Categories : IOS

IOS : UICollectionView inside UIScrollView index not incremented
Hi First of all I need more detail about your question but I am assuming that you want your UICollectionView scrollable and actually its not scrolling. So could you check following points :- UserEnableInteraction for collection view should be enabled. And also check what is the value you gave for UICollectionViewFlowLayout because just consider if You have total 5 elements to show and your UICo

Categories : IOS

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




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