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

Code execution stops on using thread safe Singleton initialization code

To make use of global variables and methods I implemented Singleton as a healthy coding practice. I followed Apple documents, john wordsworth blog before implementing it. In the first, I did not make my singleton thread safe and I implemented this method along with all other mentioned in the blog and Apple document. + (SingletonClass […]

Count value is changed when tableview is scrolling

This question already has an answer here: Scrolling the tableview count label value is changed? 7 answers

Read current location name using Map View in iPhone

I read the current location’s latitude and longitude values and then pin that location in iPhone successfully. Now I want to read that place name using this latitude and longitude values. I used the following code to read the find the current location: – (void)mapView:(MKMapView *)mapView1 didUpdateUserLocation:(MKUserLocation *)userLocation{ CLLocation *whereIAm = userLocation.location; NSLog(@”I’m at %@”, […]

Can NSRange determine if a snippet of text exists in a larger string?

I have a large string coming back from an http GET and I’m trying to determine if it has a specific snippet of text or not (please forgive my sins here) My question is this: Can / Should I use NSRange to determine if this snippet of text does exist? NSRange textRange; textRange =[[responseString lowercaseString] […]

How to convert Html tags to plain text in iPhone

I have webservice response like this. NSString *str= @”Slight <b>left</b> onto <b>Adelaide Rd/B509</b><div style=”font-size:0.9em”>Continue to follow Adelaide Rd</div>”; I have to convert html tags in the above str to plain text.Can u please suggest me solution for this.

addObject replaces previous object in NSMutableArray

I’m trying to add objects to a NSMutableArray through a for loop. But it seems whenever I add an object it replaces the old one so that I only have one object in the array at the time… Do you have any idea of what might be wrong? – (void)viewDidLoad { [super viewDidLoad]; LoginInfo *info […]

iOS Framework issue: Class is implemented in both

I’m working on an iOS framework project which is using a third-party framework classes so I added third-party framework under Linked frameworks and libraries section. When I add my custom framework in my iOS app project, I’m getting this warning for each class objc[3139]: Class ‘class_name’ is implemented in both /private/var/containers/Bundle/Application/C131AF0F-7CF8-4360-8716-3E8A595169D6/’app_name’.app/Frameworks/’framework_name’.framework/’framework_name’ and /var/containers/Bundle/Application/C131AF0F-7CF8-4360-8716-3E8A595169D6/’app_name’.app/’app_name’. One of […]

iPhone / iPad user profile tracking

My iphone app downloads user specific data from our web server. How can I identify a unique user/device? cookie? ip address? or do I need them to register first? What are some issues I need to be aware of? best practices?

dyld: Symbol not found: ___NSDictionary0__ when using google ServiceGenerator binary with discovery docs in XCode 7 & iOS target 9.0

I’m trying to generate client API code from Google backend using Google serviceGenerator with discovery document as input. Following is the exact command : /Users/raja/Library/Developer/Xcode/DerivedData/ServiceGenerator-dycdiotwolfqnaelznaucewpppjr/Build/Products/Debug/ServiceGenerator ./userRecordApi-v1-rpc.discovery –outputDir ~/API I however, see the following error dyld: Symbol not found: ___NSDictionary0__ Referenced from: /Users/raja/Library/Developer/Xcode/DerivedData/ServiceGenerator-dycdiotwolfqnaelznaucewpppjr/Build/Products/Debug/ServiceGenerator (which was built for Mac OS X 10.11) Expected in: /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation in /Users/raja/Library/Developer/Xcode/DerivedData/ServiceGenerator-dycdiotwolfqnaelznaucewpppjr/Build/Products/Debug/ServiceGenerator […]

Will this Objective-C, nested NSArray cause a memory leak on iPhone?

NSArray *tLines = [[NSArray alloc] initWithObjects: [[NSArray alloc] initWithObjects:@”Matt”, @”David”, nil], [[NSArray alloc] initWithObjects:@”Bob”, @”Ken”, nil], nil]; self.lines = tLines; [tLines release]; I’m allocing NSArrays within an NSArray, will the nested arrays get released when I call [lines release];?