objective-c

For Loop Question?

I'm programming an app for the iPhone. I'm not very good with loops just yet. How do I shorten this code into a for loop? if(CGRectContainsRect([space1 frame], [box frame])){ space1.image = [UIImage imageNamed:@"box.png"]; } else if(CGRectContainsRect([space2 frame], [box frame])){ space2.image = [UIImage imageNamed:@"box.png...

How to set UISCrollView's contentOffset during zooming(scrolling)?

I am dealing with UIScrollView and I need to dynamically set contentOffset. But I found it didn't work well if you set contentOffset during the zooming(scrolling) operation. It seems the touches will affect setting contentOffset. Any idea about this? ...

Integrating a C project in the iPhone SDK

Hello, This is my first time doing this sort of project so apologies if the question is silly. I've got a question about using a C project with a project in the iPhone SDK. I've dragged and dropped the C project into the iPhone project in Xcode (so it appears in the screenshot below). sjeng.h is a file inside GameEngine.xcodeproj, but...

access music database from cocoa

How do I access the iTunes database from my application. I seems apple can access iphone and itunes from their apps. How do I do the same? ...

How to convert image sequences (PNG) into Animation File (gif/mov/others) (iPhone) ?

I have a sequence of images (PNG format) in my iphone app. It is saved in the app's sandbox doc folder. How do I create animation file from these images? I would prefer animated gif, but other types like video (mov/avi/etc) is ok too. I don't need audio. Just images. Thanks. ...

Retrieve Itunes account when performing inapp purchase.

Hello experts! I have created an app which allows users to buy non-consumable content. The retrieving-ids-payment-process works like a charm but i wish too, when the transaction is completed and the request is made to download the content, I would like to save who has downloaded this content. In my observer i have implemented method: -...

Getting memory allocation in segement control

Hi guys, I'm getting object allocation at segement control.I used same controller for adding favourites and while in didselect action.In present modelviewcontrol i didn't use segment control and in didselect i used segemnt control .So, am not getting how to release segemnt control . Can any one help to solve this. Thanks in advance. ...

Save downloaded content when in app purchase is complete

Hello experts! I have created an app which allows users to buy non-consumable content. The retrieving-ids-payment-process works like a charm. What i can't really figure out is how my content should be saved into the phone. The existing structure is that I have all my current content in Resources/packages/. For every package there is an ...

How do I start a new Obj-C library project with Xcode?

Hello, I am new to Xcode (and Objective C in general) and I want to create a new Objective-C Library (Framework?) which will be used by some of our iPhone applications in the future. Which type of project should I choose when Xcode shows the new project dialog? I tried selecting "Blank Project" but then I faced some issues in defining t...

Getting Object allocation at UIBarButtons

Hi guys, Im getting allocation at UIBarbutton that i added to toolbar. masterviewcontroller.h UIBarButtonItem *markReadItems; UIBarButtonItem *markUnReadItems; UIBarButtonItem *refreshItems masterviewcontroller.m -(id)init{ if(self = [super init]){ refreshItems = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystem...

Getting Memory allocation problem at UIBarButtonItem in Iphone sdk.

Hi guys, Here I am getting memory allocation problem at UIBarButtonItem and the related code for that is: toolbar = [UIToolbar new]; toolbar.barStyle = UIBarStyleBlackOpaque; [toolbar setFrame:CGRectMake(0, 350,320,20)]; [self.view addSubview:toolbar]; UIBarButtonItem* barItem1 = [[UIBarButtonItem alloc] initWithBarBu...

Cocoa - How to copy files to /usr/share?

Hi all. I'm developing an "installation" like cocoa application wich needs to take care of some http request, some file system reading, copying files to /usr/share, set up cron (not launchd) and ask some information to user. I discarded PackageMaker since I need more flexibility. Currently everything is going well, but on my last instal...

Do I need to override the writing methods of NSDocument in subclasses for an application that will only be a viewer for files.

I think I may be missing the obvious but I'm not sure. The section on subclassing NSDocument in the docs states that subclasses of NSDocument must override one reading and one writing method. If I'm creating a viewer application that will not write anything back, do I still need to override a writing method (returning what, nil?) or ca...

Xcode - Terminating due to uncaught exception for iphone app

When I try to cick on cell in my table view rather than take me to the next view I get a "Terminating due to uncaught exception" error. Here is the code from the debugger: 010-03-27 12:52:48.805 MultiDetailView[335:207] *** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[NSCFArray objectAtIndex:]: index (1...

NSMutable String "Out of scope"

I have two NSMutableString objects defined in my viewController's (a subclass of UITableViewController) .h file: NSMutableString *firstName; NSMutableString *lastName; They are properties: @property (nonatomic, retain) NSMutableString *firstName; @property (nonatomic, retain) NSMutableString *lastName; I synthesis them in the .m fi...

Interoperability between two AES algorithms

Hello, I'm new to cryptography and I'm building some test applications to try and understand the basics of it. I'm not trying to build the algorithms from scratch but I'm trying to make two different AES-256 implementation talk to each other. I've got a database that was populated with this Javascript implementation stored in Base64. N...

Passing an NSDate

I'm new to the iPhone and objective-c and I am still trying to get my head around ownership of objects so bear with me. I have a DOBViewController that has a datepicker on it. I have created a custom init method: -(id)initWithInitialDate(NSDate *)initialDate; Another view controller has a date instance declared (NSDate *dob) that hol...

Calling a method from another view in objective-c. (iphone sdk).

Hello. I am currently creating a multi-view game on the iPhone platform. I have my main view start to play some background music upon loading. I then go to another view and start the game. I am trying to get the background music from the original view to stop once I start the game. I am having trouble getting the stop playing music ...

NSOperation for animation loop causes strange scrolling behaviour

Hi, I've created an animation loop which I run as an operation in order to keep the rest of my interface responsive. Whilst almost there, there is still one remaining issue. My UIScrollViews don't seem to be reliably picking up when a user touch ends. What this means is, for example, if a user drags down on a scroll view, when they lift...

Iphone 3.3 blocks

I am tyring to use Objective C blocks on an iPhone 3.3 app but am getting a linkage error: "_NSConcreteGlobalBlock," referenced from: Any ideas as to whether blocks are supported in the iPhone 3.2 SDK? I found conflicting reports on the internet. ...