objective-c

iphone application unit testing problem

If followed the apple tutorial for setting up application unit tests. I have two issues with "Application Unit Tests". The first is that I get a warning running application unit tests (see below). warning: Unable to read symbols for "/Developer/Platforms/iPhoneOS.platform/DeviceSupport/3.2.2/Symbols/Developer/Library/PrivateFrameworks...

How do I flag a method as deprecated in Objective-C 2.0?

I'm part of a team developing a fairly large iPad app and there are many different classes we've created as a result. The trouble is some of the methods are now pretty much obsolete and I don't want simply remove them yet as I know some parts of the overall system use the methods... but there are better (newer) variants available which ...

Application Failed to Launch in Time

How can I diagnose this error? Application Specific Information: MyApp failed to launch in time Elapsed total CPU time (seconds): 4913.443 (user 3868.270, system 1045.173), 56% CPU Elapsed application CPU time (seconds): 0.010, 0% CPU Backtrace not available Unknown thread crashed with unknown flavor: 5, state_co...

How should I store UIImages within my Core Data database?

I am developing an application which demands around 100 images or maybe more to be pre-inserted into the Core Data database along with other related information. Now I can easily add other data by just writing a few lines of code but for UIImages I am unsure how to do it without writing a lot of code. I was wondering: is there anyway t...

NSDateFormatter for NSFetchedResultsSectionInfo name

I've created a table view of "log entries" which are organized into section based on the day they were entered. I'm using Core Data so in order to do this I defined the following readonly calculated property in my NSManagedObject: - (NSString *)formattedDay { NSDateFormatter *df = [[NSDateFormatter alloc] init]; [df setTimeStyl...

Making change using Objective-C

Hi, I just recently started studying Objective-C (or programming for that matter) and am stuck at a simple program. I'm trying to create change in quarters, dimes, nickels, and pennies but noticed that the solution I came up with would give random value to nickels or pennies. Ex. Change for 25 would come out to "The change is 1 quarte...

animations on infinite loop

I have 5 different animations that animate then disappear one after another. Is there a way to put them on an infinite loop so animation #1 begins and ends, then anim #2 begins and ends etc..? the whole process then would repeat on an infinite loop. I have the animations in separate blocks on delays. I'm guessing that there is a better ...

Array with a NSDictionary doesn't want to save to the standardUserDefaults

Hello, I am having a... strange problem. I am adding an NSDictionary to an NSArray, then saving it to the defaults. When I check the object count of that key on the user defaults, it says the count is 0, but the array that's "on memory" has that object (so the count is 1). The code, along with the output it gives is this: (array is a...

Combining objects in an array

I have one array that is pre-filled with dictionaries with each dictionary consisting of two keys. { name = object1; quantity = 5; }, { name = object2; quantity = 2; } I want to be able to add more objects and combine any duplicate dictionaries. So for example, if I added 5 of object one and 3 of object 2, this would be t...

iphone: QuartzCore and animations work in simulator but not in device

I currently have 3 simple UIImageViews that animate across a UIView in my app. The animations work fine in the simulator. However, when I test the app on the device, all I see is a blank UIView. Are there any special libraries/header files I need to import to fix the problem of animation not appearing on the device? ...

How to use web request results (xml, plist, etc) as a datasource for UITableView

I want to use coldfusion web query results to populate a UITableView in iOS. The query results come back as a string and I guess I need to convert them to NSArray or NSDictionary... Thanks, Phill ...

Objective-C initialize (static method) called more that once?

I have code similar to this in Objective-C: SubclassOfNSObject *GlobalVariableThatShouldNeverChange; @implementation MyClass +(void) initialize { [super initialize]; GlobalVariableThatShouldNeverChange = [[SubclassOfNSObject alloc] init]; // Change more stuff with GlobalVariableThatShouldNeverChange } @end I have this r...

Getting current device language in iOS?

I'd like to show the current language that the device UI is using. What code would I use? I want this as an NSString in fully spelled out format. (Not @"en_US") ...

drawRect: isn't working.

I want to place some "handles" on a UIView I have on-screen. So, I'm creating more UIViews, one at each corner of the UIView's frame rectangle, and I simply want to draw a circle that "fills" the rectangle that is the frame of the "handle" UIView. Here's what I mean: How I create the "HandleView": CGPoint upperLeft = CGPointMake([[se...

Round number using NSNumberFormatter without using strings

Hi all, This seems really simple but I can't see that NSNumberFormatter has a function for this which is strange. I have a number, lets say 4.1. I want to round that to 5. I figured if I used NSNumberFormatter and set the roundingMode to NSNumberFormatterRoundUp I would get the desired result. But the only way I seem to be able get my n...

send string data to max msp from iphone over wifi local network

as the question says, i want to simply send data from the iphone (ipad later) to a computer so max msp can retrieve the data (string) and do whatever over a wifi local network. Its as simple as that. i don't want fancy any interface on the sending/receiving end or any extra options. Thats all i want. Can anyone guide me with this ple...

Objective-C Proper way to create class with only one instance

I am trying to implement a class, that subclasses NSObject directly, that can only have one instance available throughout the entire time the application using it is running. Currently I have this approach: // MyClass.h @interface MyClass : NSObject +(MyClass *) instance; @end And the implementation: // MyClass.m // static inst...

One App, Multiple Branding

I have made an application for the iPhone but it is required to be released with multiple brandings. Eg Differernt: App Name Icons Default.png Text replaced for the app name in IB Colour schemes for all images such as backgrounds, icons etc I'm not sure of the best way to do this. I was thinking of a plist file for each branding th...

NSString drawInRect with UILineBreakModeTailTruncation doesn't appear the "..."

I am trying to use this method to draw a string into a custom UITableViewCell. [self.text drawInRect:TEXT_RECT withFont:font lineBreakMode:UILineBreakModeTailTruncation alignment:UITextAlignmentLeft]; The problem is that if the text is too long, the text is actually tail truncate but it doesn't display the "..." If I use the draw...

How to call a method from another method in Objective C ?

Can someone answer me how to call one method into another in Objective C on Xcode ...