objective-c

How to fetch data from xml string to variables in objective c?

Hello, I am new to objective c. I am right now working on the web service based application.I am using .net webservice that i would like to point out. The thing is that using XML code,i am able to fetch the XML string in a simple string variable,but i cant get how to get data from the same in different variable. <?xml version="1.0" ...

iPhone : xml parsing problem

hi all, I do have an xml file like, <posts> < photo id="12412" private="false" > <title>happy_diwali_diya_wallpaper</title> <caption>Happy Diwali</caption> <dateCreated>2010-10-14</dateCreated> <dateLastUpdated>2010-10-14</dateLastUpdated> <postDate>2010-10-14</postDate> <orientation>HORIZONTAL</orie...

What are all the protocols are supported in iPhone sdk?

Hi Guy's I need a confirmation that what all the protocols supported by iphone sdk among the protocols I mentioned. SIP RTSP Mobile 3G-324M Run on Wi-Fi networks Anyone's help will be much appreciated. Thanks ...

retrieve video file name using AssetLibrary in objective c

Hi, I would like to know how is there file name for video in photo album in iphone? If yes, how do i retrieve it using AssetLibrary? possible some code snippet? Thanks in advance ...

Changing items in TTLauncherView according to TabBar

Hi, I'm developing an iPhone application using the Three20 library. The main screen is a TTLauncherView (with images inside, like Facebook) and a TabBar at the bottom. Each time a new item is selected in the TabBar, I have to change the images inside my TTLauncherView. I thought that I only had to change the "pages" property of my TTLa...

How do I set the color of an NSButtonCell text label

How do I set the color of an NSButtonCell's label (title) text, that is the column cell for a table view? In my case, it is an checkbox button cell. (Is it possible using IB?) ...

executeFetchRequest crashes on third call

I have a weird problem in my Objective-C code. I have a View Controller where I call my own loadData method in "viewWillAppear". This works cool until the view becomes visible the third time. Than the app crashes without any exceptions or other hints when I call NSArray *storeListArray = [managedObjectContext executeFetchRequest:fetchR...

Delegate confusion .. How do I find out when several delegates have finished their task?

I've built a basic Web XML to Core Data parsing system, but I am confused about how to set off several parsers at once, and know when they are all done. This is my current setup, which gets just one parsed xml file ("news"). But I have several xml files I need to parse ("sport", "shop" etc). How would set all of these off, and know when...

Why is NSXMLParser crashing for me on 10.5? (Mostly PowerPC, but some Intel.)

I have some strange problems with crash reports from 10.5. Thread 11 Crashed: 0 libxml2.2.dylib 0x93753ec0 xmlClearParserCtxt + 1776 1 libxml2.2.dylib 0x9372f724 xmlParseCharData + 308 2 libxml2.2.dylib 0x93735034 xmlParseChunk + 3624 3 com.apple.Foundation 0x920c57c0 -[...

Split function in objective-c (card game)

Hi, i'm beginner in objective c, i'm creating a card game for iPhone and I've a problem with a function: I create a deck of cards, shuffle it and now I need to split the deck in 4 hands (for the 4 players) Here is my function : -(void) split(int i1, int i2, int i3) { NSMutableArray *list1; NSMutableArray *list2; NSMutable...

NSPredicate in NSFetchedResultsController acting strange

NSPredicate *predicate = [NSPredicate predicateWithFormat:@"List.name == 'kristof\\'s list'"]; Works as expected. However I want do something like this: NSString *listName = [[[detailItem valueForKey:@"name"] description] stringByReplacingOccurrencesOfString:@"'" withString:@"\\'"]; NSPredicate *predicate = [NSPredicate predicate...

How do I draw a line with a specific texture, like chalk?

How would I draw features with a texture in an iPhone application? Basically what I want to do is to draw a line that has a specific texture, like a line of chalk. ...

How to launch a TTTableView based view with TTLauncherView ?

Hi again, I'm very newbie with Three20. I'm trying to make an TTLauncherView based interface, without success for now. My LauncherView contains a button, mapped to an URL. When I click on this button, I want a TTTableView based to be displayed on screen. But I have nothing. Here is a piece of my AppDelegate code : [map from:@"tt://ra...

What is the fastest way to sort a lot of locations on distance?

I want to sort lots of locations (waypoints) on their distance from the current location. The current location is, of course, a moving target, so for every location update, recomputing the distance for every location is necessary. But only recomputing for close-by locations would by enough. I currently use core-data, and store the dista...

[NSNull isEqualToString]

My program is crashing as a result of the runtime sending isEqualToString: to a NSNull object. I cannot find where this NSNull is coming from; I never explicitly create one. I also can't find at all who or what is calling isEqualToString. My understanding is that NSNull is an objected used only to get around the fact that you cannot add...

Detect which button is pressed? (then action)

Hi guys! That's my very first post on SOF. I'm a new programmer at objective-c. Heres the "problem" i'm dealing with I created 2 UIbutton : one to pull an UIImageView from the top of the screen and the other to push it back. I have the code for the action** but i dont know how to relate it to an if-statement if(button1 pressed) then pu...

iPad: NSAutoreleasePool with animation, and release confusion.

I have two related questions concerning NSAutoreleasePool. Between declaring the pool and draining it, can I use animation? Example NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; subView.alpha = 0.10; [UIView beginAnimations:nil context:NULL]; [UIView setAnimationDuration:1.0]; [UIView setAnimationDelegate:self]; [UIView ...

EXC_BAD_ACCESS signal received

I am getting a EXC_BAD_ACCESS signal when calling the following line: self.distance = [NSNumber numberWithDouble:[currentLocation distanceFromLocation: self.location]]; This is only happening in iOS 3.2 for iPad, I know this is a memory issue but i can't seem to see what is wrong with the above line? edit: here is the full method: ...

reset app on user exit

is there a way to restore an app to the original settings when a user exits? I need the app the reset every time it's closed out. thanks so much. ...

How to initialize an NSData in order to store MAX_SIZE_BUFFER bytes ?

Hi, I have just realized I lost 30 minutes searching in Xcode NSData Class reference how to do this in objc (sorry I explain this in C as this in the only language which comes without thinking too much): #define MAX_SIZE_BUFFER 500 byte *ptr; ptr = malloc(MAX_SIZE_BUFFER * sizeof(byte)); memset(ptr, 0, MAX_SIZE_BUFFER); I started to ...