objective-c

NSDate - Change Time Component

This is probably a silly question but I can't seem to find an answer. I am using a date picker to allow a user to enter a date and it is also setting the time to the current time (I init the picker with [NSDate date]). Is there a way to change the time component of the date? I am later calculating time intervals which returns seconds...

How can we store into an NSDictionary? What is the difference between NSDictionary and NSMutableDictionary?

I am developing an application in which i want to use an NSDictionary. Can anyone please send me a sample code explaining the procedure how to use an NSDictionary to store Data with a perfect example? ...

Codesign error: Provisioning profile cannot be found after deleting expired profile

Tried to rebuild an app that was just working yesterday. Got a message that a profile had expired, so I removed it from the iPod and from Itunes. When I chose a new profile (one with an * in the identifier), I now get an error: Code Sign Error: Provisioning Profile (long string) can't be found. What am I missing? I looked through rel...

Automatically populate all properties of an Objective C instance with a dictionary

I have a class with properties that I would like to set values from a dictionary. In other words, I would like to automate this: objectInstace.val1 = [dict objectForKey:@"val1"]; objectInstace.val2 = [dict objectForKey:@"val2"]; with something like this (pseudo code): for key, value in dict: setattr(objectInstance, key, value) ...

passing primitive or struct type as function argument

I'm trying to write some reasonably generic networking code. I have several kinds of packets, each represented by a different struct. The function where all my sending occurs looks like: - (void)sendUpdatePacket:(MyPacketType)packet{ for(NSNetService *service in _services) for(NSData *address in [service addresses]) ...

iPhone: How to get a UIImage from a url?

How do you download an image and turn it into a UIImage? ...

Objective-C code not deallocating memory!

I'm trying to learn Objective-C. I almost finished one excercise but it is not deallocating the memory: This is is what I have: void PrintPolygonInfo() { NSLog(@"--------------------"); NSLog(@" PRINT POLYGON INFO"); NSLog(@"--------------------"); NSMutableArray *array = [[NSMutableArray alloc] init]; PolygonShape ...

Namespace convention for Objetive-C

I'd like to group classes so they must be referenced like this: Root.Web Root.Mail Root.Audio Each of the above classes corresponds to a file: Web.h Mail.h Audio.h The goal is to use the above "Root" syntax rather than just: Audio myAudio = [[Audio alloc] init]; Instead, it should look like: Root.Audio myAudio = [[Root.Audio ...

UIPageControl dot for a search page

Hello, there! Is there any way to add a magnification glass icon instead of the dot for my first page, that allows to perform some search, using the UIPageControl for my native application on the iPhone? I've tried to google, but haven't find similar questions at all, but it looks like a wide-spread feature in Apple applications. Can ...

"Executable was signed with invalid entitlements" when adding code signing entitlements

Hi! I am about to publish my first free app on the appstore. Following the instruction on the developer portal, I have added an "Entitlements.plist" file, and referenced this file in the "code signing entitlements" project setting. After I did this I can no longer test the app on my Ipod, with this error message "Executable was signed w...

Nested UIScrollView-iPhone photos application

Hi, I have been facing the same nested UIScrollView problem for long time.I tried some open source codes like Scrolling madness ,three-20 and others but all fails finaly.I am trying to make a photo Viewer application same as iPhone.For that I have created the structure like this:- 1)one View controller. 2)on view of view controller one...

How to use Objective-c NSTimeZone to convert system timezone to destination's local timezone?

Hi, everyone. I am working on a project which involved in converting current time on iPhone to target destination's time. For example, the application needs to convert current time (08:00) to Germany's local time. I have information about timezone (like UTC +1) and tried to search about how to use NSTimeZone to convert the NSDate value...

What is a registered prefix???

Hi, I want to know what is a registered prefix that has to be done before the url to be called in Objective-C programming of iPhone OS?? Can u explain me with an example?? ...

XCode missing inline test results

Everywhere there are pretty pictures of failing tests shown inline in the code editor, like in Peepcodes Objective-C for Rubyist screencast and in apples own technical documentation: When I build my test-target, all I get is a little red icon down in the right corner, stating something went wrong. When clicking on it, I get the Build...

customizing a cell in table.

hi, I want to have an image on left side of the cell. A text also in same cell. I should have a number of cells in a table. Where should i store the images ? And how should I place in the table ? Thank You. ...

How can I use goto in a switch statement in Objective-C?

In my code I need to be able to jump (goto) a different case within the same switch statement. Is there a way to do this? My code is something like this: (There is a lot of code I just left it all out) switch (viewNumber) { case 500: // [...] break; case 501: // [...] break; . . . . . case 510: // [...] break...

Cocoa Distributed Objects

Hello, I've given myself a headache trying to figure out how to run this Distributed Objects demo. I can run it just fine locally on the same machine. Here's the situation. I have a Server App that spawns a Client App [with OpenGLView] on a remote machine. I can do this easy with AppleScript. The Client App seems to Vend it's OpenG...

What are the limitations of C++ running on the iPhone?

I like C++ a lot and to be honest the Objective-C "super set" of C is more of a "super fail". Can an iPhone application be written in pure C++? Are there parts of the API that are unavailable from C++? ...

How to create custom UIAlertView

We're creating an immersive app that needs to have something that acts rather similar to a UIAlertView, but we don't want it to look like a system dialog, we want to use our own graphics. I've got a big chunk of the work done, but there are a few snags I've hit: How do I make the UIView show up above the status bar (so that I can dark...

How can I check if a WebView URL is a local file??

Hi guys, I have this question that is unsolved for me.... I need to check if the current URL of my webview is a local file in the Documents directory of my app....how can I do this?? Thanks! ...