iOS Development is easy with XCode, Swift3, UITableView, cocatouch, let's build iPhone, iPad and Macbook Applications.

How to save the response From My server , and How can i access That data

Hi i am getting the response from my server successfully.i need to access the user_id send by the server in my app. check my code: NSURLSessionConfiguration *defaultConfigObject = [NSURLSessionConfiguration defaultSessionConfiguration]; NSURLSession *defaultSession = [NSURLSession sessionWithConfiguration: defaultConfigObject delegate: nil delegateQueue: [NSOperationQueue mainQueue]]; NSURL * url = [NSURL URLWithString:@”my url”]; NSMutableURLRequest * urlRequest = [NSMutableURLRequest requestWithURL:url]; NSString […]

NSMutableArray replace object

I try to find object in my array and if success I need to replace object from my array to new object for (id existingSig in allSignature) if ([[existingSig objectForKey:@”SignatureName”] isEqualToString:[item objectForKey:@”name”]]) { [allSignature removeObject:existingSig]; [allSignature addObject:[NSDictionary dictionaryWithObjectsAndKeys:@”1″, @”SignatureIsRich”, [item objectForKey:@”name”], @”SignatureName”, generatedID, @”SignatureUniqueId”, nil]]; } I have error ‘NSCFArray: 0x100551f10> was mutated while being […]

How to disable Copy & Define UIMenuItems of UIMenuController in UITextfield

I am implementing custom UIMenuController and trying to figure out. How can I legally disable “Copy” and “Define” UIMenuItems of UIMenuController in UITextfield? Textfield is not editable. I tried to disable “Copy” using: -(BOOL)canPerformAction:(SEL)action withSender:(id)sender { if (action == @selector(copy:)) { return NO; } return [super canPerformAction:action withSender:sender]; } – (IBAction)tapTextViewGesture:(id)sender { UIMenuItem *myItem1 = […]

Facebook SDK 3.6 Open Graph Error Message

Im trying to use the new Share Dialog and it works fine when the facebook app is not installed and im sharing with my own viewcontroller: if (!call) { // Fallback to customized share UI MyShareViewController *viewController = [[MyShareViewController alloc] initWithItem:object objectType:@”objecttype” actionType:@”namespace:action”]; [_delegate showFallbackShareDialog:viewController]; } So this code only gets called when the facebook […]

ImagePicker Library with custom crop rect?

I have been searching around for a long time now trying to find a custom UIImagePickerController-like library that enables custom crop sizes. I’ve also read a number of posts on this site and others: Custom image crop in IOS UIImage: Resize then crop Cropping a UIImage Custom crop rect for UIImagePickerController As you’ll notice most […]

Strange problem with reading and writing a plist file

I have an application that read info from I plist file. To do it I use this code below: NSData *plistData; NSString *error; NSPropertyListFormat format; id plist; localizedPath = [[NSBundle mainBundle] pathForResource:@”settings” ofType:@”plist”]; plistData = [NSData dataWithContentsOfFile:localizedPath]; plist = [NSPropertyListSerialization propertyListFromData:plistData mutabilityOption:NSPropertyListImmutable format:&format errorDescription:&error]; if (!plist) { NSLog(@”Error reading plist from file ‘%s’, error = […]

iPhone Brainstorm – CLLocation in Background – Polling every 15 minutes

Here is the scenario. I need to have an application which polls a web service with the users location every 15 minutes whether in background / foreground. At the moment I: Start / Restart the location manager with accuracy highest and distance filter none. Wait to get within desired accurancy. Store reading setDesiredAccuracy to be: […]

Set titleview for all navigationcontroller and navigationitem

[[[UINavigationBar appearance] setTitleView:button] I tried to set title view as button for all navigation item using above line of code but it is not working.How can I set title view for all navigation bars in my project by writing small code in appdelegate ?

UIWebView: open some links in Safari, some within the view

My app features content that (for text formatting reasons) is presented in an UIWebView. Within the content there are links, some of which should open their target in mobile Safari, while others should navigate within the content. So far, I’ve catched the link requests using a UIWebView delegate. In my implementation of -(BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest […]

Restrict Rotation in Tab Bar View Controllers

UPDATE 2 In my UITabBarController subclass I tried adding this: -(void) tabBarController:(UITabBarController *)tabBarController didSelectViewController:(UIViewController *)viewController { NSNumber *value = [NSNumber numberWithInt:UIInterfaceOrientationPortrait]; [[UIDevice currentDevice] setValue:value forKey:@”orientation”]; } Now, everytime I select a tab item, the device rotates to portrait mode perfectly. However, now I can rotate the device while (a) is selected, and the device will […]