objective-c

Objective-C NSDictionary value comparison

I am returning a string of either T or F from an NSDictionary key value pair. I'm trying to find out if it is the T or the F, but it never works like I would expect it to. I'm sure there is a very basic solution for this issue. if ([game objectForKey:@"complete"] == @"T") never evaluates to true. ...

Formatting html tags in Objective-C

Hi, I am reading an data from an XML file for my iPhone application. This data contains html tags such as <p></p> <strong> <B>, etc in it. By using NSString class can i remove these tags and format the display of the text as needed. For example, if text inside the <p> </p> i want to display it in next paragraph. Is it possible? Pleas...

IDE For Objective-C On Linux

Hello, I'm learning Objective-C and i would like to know where i can found a IDE for Objective-C on Linux? ...

Cocoa-Touch: How to: custom UITableViewCell with UIColor clearColor background

I have a UITableView with custom cells. I have MyTableViewCell : UITableViewCell and MyTableViewCellContentView : UIView classes. What I'm doing is basically what is done in the AdvancedTableViewCells demo app from Apple with a slight change, on some rows I want to use a clearColor background to show the table's background behind the pa...

How do I work around deprecated properties/methods with (possibly non-object) arguments?

My goal is to achieve compatibility across 3.x SDK versions for UIImagePickerController and it's allows(Image)Editing property. // SDK 2.0 to 3.0 myImagePickerController.allowsImageEditing = YES; // SDK 3.1 myImagePickerController.allowsEditing = YES; Some research reveals some objective-c approaches, but what is considered best prac...

Generate Method Header and Implementation in xcode

In objective-c/xcode, is there a way to write the definition of a method in the implementation and have automatically added to the header file? ...

NSSThread identifier

Hi, is there anything like an identifier of a NSSThread? The following code: NSLog(@"thread: %@",(NSThread*)aThread); results in something like this: Thread: {name = (null), num = 6} Is there a way to get this thread number, maybe? Best, heinrich ...

How to Force UIButton to Refresh?

I have working snippet along the lines of: for (UIButton *b in buttonMapping) { [b setTitle:@"yo!" forState:UIControlStateNormal]; [NSThread sleepForTimeInterval:1.0]; } There's four buttons, all four buttons update. However, instead of updating one per second, four seconds go by & they all update. How can I force UIButton to up...

Break on EXC_BAD_ACCESS in XCode?

I'm new to iPhone development and XCode in general and have no idea how to begin troubleshooting an EXC_BAD_ACCESS signal. How can I get XCode to break at the exact line that is causing the error? I can't seem to get XCode to stop on the line causing the problem, but I do see the following lines in my debug console: Sun Oct 25 15:...

BitBlt() equivalent in Objective-C/Cocoa

I made a scrolling tile 2D video game in visual basic a few years back. I am translating it to Cocoa for the Mac. Is there a framework that would allow me to use BitBlt? Or is there an equivalent to BitBlt without using OpenGL? Thanks! ...

Core Data Classes vs Model

I've recently started down the road of programming in Objective-C, and I'm now looking into Core Data. However, I am confused about exactly what defines the model itself in Core Data. Here's what I mean: Say I create an entity with some set of attributes using the graphical model builder. I then have Xcode generate code for the corre...

iPhone - Multiple TableViews in one View?

How exactly does one implement two separate "tableviews" on one view like in this image: ...

NSString drawInRect overlaps all characters

I am attempting to fill some text with a gradient-fill, where by I set the text drawing mode to clipping, and then paint a gradient-fill. The problem is, whenever I set the text drawing mode to clip, every character of the text string is placed on top of each other, rather than being painted in a sequence to form a word - it is most biza...

Cocoa-Touch: When implementing drawRect, how do you redraw the transparent background?

I'm implementing a UIView's (UITableViewCell to be more exact) drawRect method. My view has a transparent background, so when something is changed in the view, the older drawn version still remains there. So if on the first drawRect draw an "A", then a "B" on the same point, I get both of them drawn on top of each other. How can I tell ...

Declaring an object at class level, problems. iPhone Objective-C

Objective C on iPhone: I am attempting to declare the following object at class level so that i do not have to re-connect this socket every time I write something to it. (Writing things multiple times a second) whenever i am writing a steady stream of live data, about every 2 seconds it freezes. I don't know why, but it does. Code: Soc...

iPhone Syncing a time sequence with music

Hey I'm using AVAudioPlayer to play music in my iPhone app. In a class that I wrote I have an array that contains random ascending integers. (2, 4, 9, 17, 18, 20,...) These integers represent times in the song at which a certain event should occur. So if you take the above array, after 2 seconds of the song playing, some method should...

How can I solve this memory Leak? NSInvocation

-(void)invokeMethod { NSMethodSignature * sig = [[source class] instanceMethodSignatureForSelector:@selector(mySelector:)]; NSInvocation * invocation = [NSInvocation invocationWithMethodSignature:sig]; [invocation setTarget:myTarget]; [invocation setSelector:@selector(mySelector:)]; MySubClassOfNSInvocationOperation...

Best way to implement Enums with Core Data

What is the best way to bind Core Data entities to enum values so that I am able to assign a type property to the entity? In other words, I have an entity called Item with an itemType property that I want to be bound to an enum, what is the best way of going about this. ...

NSError question

I have been creating a peer to peer connection for a new game, that does not use the peer picker. I am however dumbstruck as what to i put in here: - (void)session:(GKSession *)session didReceiveConnectionRequestFromPeer:(NSString *)peerID { NSLog(@"I GOTS A CONNECTION REQUEST"); if(connected == YES) { //deny all requests } else if(con...

how to find ip of iphone device programatically??

how to find ip of iphone device programatically?? ...