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

Unicode strings in JSON string

I know how to consume JSON string in Objective C. For example: { “name”:”school”, “address”:”very near here” } This is easy because the strings are plain English. The situation is I’d like to read JSON data that contains Unicode strings For example: { “name”:”trường học”, “address”:”rất gần đây” } The strings above are Vietnamese. or […]

NSUInteger in reversed loop confusion?

I wonder if someone can explain something, I setup a loop where I wanted to count backwards from 10 to 0 : for(NSUInteger index = 10; index >= 0; index–) { NSLog(@”INDEX: %ld”, (long)index); } This loop runs forever, it does not stop at 0, but keeps going into negative numbers. When I noticed this […]

How can i solve CoreData mogenerator not found issue

I got the error as shown below. I don’t know what did i miss? How can i solve this issue as shown in image below: /Users/nischalhada/Documents/XcodePro/mnepalnews-revisited-2.0/CoreData mogenerator not found Command /bin/sh failed with exit code 1 Screen shots of run script I am unable to solve my problem after study of following Mogenerator not found […]

autoreleasepool was not declared in this scope error

My project is in XCode 4.2. This project compiles for a regular debug build. But when I change the build type to profile (I want to profile memory usage), I get the error from this objective-c++ c++ class: /Volumes/mchinen/scm/Voicer/FilterAudioMixer.mm:53: error: stray ‘@’ in program /Volumes/mchinen/scm/Voicer/FilterAudioMixer.mm: In member function ‘void FilterAudioMixer::WriteToBuffer(SInt16*, int)’: /Volumes/mchinen/scm/Voicer/FilterAudioMixer.mm:53: error: ‘autoreleasepool’ was […]

Retrieving Current Location and Zip using Geolocation Button

I want to place a Geolocation button near my UISearchBar, which on clicking, it should return the zip (eg. 20043). I will be using the value from the ZIP to get the list of buildings near me. I would appreciate it if someone could help me with the location Button, and what are the methods […]

NSDateFormatter not working to set setTimeZone

I am trying to know the difference between two dates (Including days,hours,minutes and seconds). For that I am using below code, but It’s not working. + (void)UpdateTableViewCellWithNSTimer:(NSString *)gameTime :(UIView *)inputView{ NSDate *now = [NSDate date]; NSDateFormatter *outputFormatter = [[NSDateFormatter alloc] init]; [outputFormatter setLocale:[NSLocale systemLocale]]; [outputFormatter setAMSymbol:@”AM”]; [outputFormatter setPMSymbol:@”PM”]; [outputFormatter setTimeZone:[NSTimeZone localTimeZone]]; [outputFormatter setDateFormat:@”mm/dd/yyyy hh:mm a”]; […]

Move UIButton above Keyboard when tapped on UITextField

I have 3 text-fields and 2 buttons. When I tap on text-field, keyboard comes up and the 2 buttons are hidden because of the keyboard. Is it possible to move the buttons above the keyboard and when the keyboard resigns the buttons should go back to their initial position.

UITableView – Keep bottom-most cell scrolled to the top?

Im creating a music based app. The playlist screen is a UITableView. It has 3 sections: Previous Tracks, Now Playing, Next Tracks. They are in order as follows: — PREVIOUS TRACKS SECTION — Track Z Track Y Track X — NOW PLAYING SECTION — Track A — NEXT TRACKS — Track B Track C Track […]

Delete a word of attributedtext on textview

I am implementing something like facebook mention. User can type their text message into the textview and mention user names. User name will be highlighted using NSAttributedString. When user wants to delete the text on the textview, I want to delete the mention name as a whole if the text is part of the mention […]

objective-c right padding

hello all hope someone can help with that. I was browsing the net and nothing really seems to make sense :S so I have a string lets say: “123” and I would like to use a function like: padr(“123”, 5, ‘x’) and the result should be: “123xx” Sorry but objecitve-c is a nightmare when dealing […]