objective-c

How to wait for a thread to finish in Objective-C

I'm trying to use a method from a class I downloaded somewhere. The method executes in the background while program execution continues. I do not want to allow program execution to continue until this method finishes. How do I do that? ...

What's the regular pattern to implement `-init` chain when subclassing UIView?

When I make an object to use in NIB, the object should implement -initWithCoder:. However I can't figure out regular pattern implementing this. I have been used this code. - (id) initWithCoder:(NSCoder *)aDecoder { if(self=[super initWithCoder:aDecoder]) { // initialize my object. } return self; } But I have to make same cod...

How to get the data from following XMl?

Hi, I have an application in which I am getting XML as below. How to parse the following XML such that I need to maintain two separate arrays for 'id' and 'last updated'. In idArray I want to maintain all the ids and in updatedArrays I want to maintain all the dates.How to do that? Both id and lastUpdate are within a single tag as below...

How should this code be changed to work correctly?

I downloaded some code from http://github.com/matej/MBProgressHUD to show a progress meter when doing something. This is the code that makes the progress meter pop up. [HUD showWhileExecuting:@selector(myTask) onTarget:self withObject:nil animated:YES]; This will show a progress meter while the method myTask is running. The strange ...

Hardware accelerated audio decoding with OpenAL

Is it possible to use the iPhone's hardware accelerated decoding of mp3s and AAC when using the OpenAL library? I suppose there are two possible approaches if this is possible. iPhone specific OpenAL extensions. iPhone APIs to decode audio into raw bytes. I have two specific use cases. Completely decode a short sound bite. Piecewise ...

view not updating, but everything on main thread (iOS)

I'm trying to show a UIProgressView on top of a table view after certain user interactions. In my table view, if the user taps one particular cell, I slide up a UIView that contains a toolbar with bar items and a picker view (it very much behaves like an action sheet). When I do this, I'm adding the view offscreen to the current view, ...

how to remove object from NSDictionary

Hi i am having a NSdictionary in which i am adding a array with key "countries ". Now i take the value of this dictionary into array and sort the array in alpahbatical order .Now i want to add this array into my Dictionary (that is i want to update my dictionary with new sorted array and remove the old array from it ).. how to do this ...

is it true no italics for iPhone 4 ?

In my project, the iPhone 4 does not show italics for command textLabel.font=[UIFont italicSystemFontOfSize:16]; but the iPhone 3 shows italics properly. Is it true that iPhone 4 does not support italics? If not using systemFont, can you get italics? thanks, Gary ...

MPMoviePlayerController error: Unable to read symbols for

Hi, if I call the movieplayer to play the following message appears on console: warning: Unable to read symbols for "/Developer/Platforms/iPhoneOS.platform/DeviceSupport/3.2.2/Symbols/System/Library/VideoDecoders/VCH263.videodecoder" (file not found). warning: Unable to read symbols for "/Developer/Platforms/iPhoneOS.platform/DeviceSup...

NSTokenField representing Core Data to-many relationship

Hi, I'm having a problem figuring out how to represent a many-to-many relationship model in a NSTokenField. I have two (relevant) models: Item Tag An item can have many tags and a tag can have many items. So it's an inverse to-many relationship. What I would like to do is represent these tags in a NSTokenField. I would like to end up...

Expected identifier or '(' before '.' token

I'm new to Objective-C so I'm using a book to get to grips with it. I'm at a bit where it's explaining structs and I can't for the life of me get them to work. I have the following code: int main (int argc, char *argv[]) { struct node { int nodeID; int x; int y; BOOL isActive; }; typede...

Class in ObjectiveC doesn't seem to recognize inherited messages

I'm learning ObjectiveC with "Programming in Objective C" by Stephen G Kochan and I'm having some difficulties with an example. It creates a simple Fraction class that inherits from Object. That's where I get into trouble, when I try to send messages that are understood by Object instead of Fraction, such as init, alloc or free (see cod...

Change Style/State of UIButton Info Dark

Hi all, I have a UIButton (Info Dark) which opens a small box on click. Is it possible to change the style/state the button so that the buttons appears highlighted or something like this as long as the box is open? Or do I have to use own background images for the button? ...

i am getting an error when i deploy on the ipod

i have created a movie application .when i run it simulator it runs without any error and gives me output.But when i try to deploy it on my ipod it gives me the following error: The executable was signed with invalid entitlements. The entitlements specified in your application’s Code Signing Entitlements file do not match those specifi...

Objective-C call specific class method

I have a class that has this in the initializer: @implementation BaseFooClass -(id) init { if (self = [super init]) { // initialize instance variables that always need to start with this value } return self; } -(id) initWithSomeInt:(int) someInt { if (self = [self init]) // <-- I need to make sure t...

How do I animate through a bunch of "paged" views in a UIScrollView?

Say I have a bunch of views in a UIScrollView and I want each one to appear on the screen, one at a time, how do I do so? ...

Adding items to string not showing characters

for (NSString *item in items) { NSString *ref = [item stringByMatching:myregex1 capture:2]; NSString *value = [item stringByMatching:myregex1 capture:3]; NSLog(@"%@ : %@", ref, value); AllOrderItems = [AllOrderItems stringByAppendingFormat:(@"%@: %@ \r\n", ref, value)]; } the AllOrderItem...

Problem with the duplicate values picking from Address book in Iphone sdk

Hi guys, Here I had a problem that I am adding contact from the address book and checking it whether it is already in the favourites list or not.If not I am adding the contact to favourite list. - (BOOL)peoplePickerNavigationController:(ABPeoplePickerNavigationController *)peoplePicker shouldContinueAfterSelectingPerson:(ABRecordRef...

Best way to maintain column data when importing multiple formats

Hi all, I have an app that imports a .CSV file and turns each line into a Core Data object that is stored in a database. The CSV files that I am importing have about 40-something columns and each column maps to an attribute of the Core Data object. When I started the project, there was only one CSV format that I was working with, so I...

implement a swipe method

hello friends, i want to know that how we can use UISwipeController in my application? ...