iphone

Add contact throws EXC_BAD_ACCESS exception for most properties (ABRecord)

Using the standard add record code I am getting a very strange error when setting properties other than FirstName and Organization (the first 2 lines work): ABRecordSetValue(person, kABPersonFirstNameProperty, location.title , nil); ABRecordSetValue(person, kABPersonOrganizationProperty, location.title , nil); ABRecordSetValue(person, k...

My Xcode only supports 3.1.2 not IPhone OS 3.1.3

What can I do?? I just upgraded my iPhone OS but now my Xcode can't run things on it. (and the newest Xcode on the apple site is like a beta version or something) ...

How Do I Take a Screen Shot of a UIView?

I am wondering how my iPhone app can take a screen shot of a specific UIView as a UIImage. I tried this code but all I get is a blank image. UIGraphicsBeginImageContext(CGSizeMake(320,480)); CGContextRef context = UIGraphicsGetCurrentContext(); [myUIView.layer drawInContext:context]; UIImage *screenShot = UIGraphicsGetImageFromCurrentI...

Is there a "simple" way to play linear PCM audio on the iPhone?

I'm making a media playback app which gets given uncompressed linear PCM (über raw) audio from a third-party decoder, but I'm going crazy when it comes to just playing back the most simple audio format I can imagine.. The final app will get the PCM data progressively as the source file streams from a server, so I looked at Audio Queues ...

smooth pendular animation with Core Animation Framework

Hi Guys, im trying to do an animation with an uiimageview. in this view is an image with an arrow, that i want to rotate about 45 degrees back and forward very smoothly like an pendular or an old clock. something like this, just smooth and with my image: http://bit.ly/cArvNw (found this with google ;) ) my current setup looks like thi...

Changing Carrier Name on the iPhone Simulator

How can i change the carrier name in the iphone simulator? The instructions here don't work for me: http://www.ipodtouchfans.com/forums/showthread.php?t=190607 ...

How do I upgrade IPhone SDK from 3.1.2 to 3.1.3

So I'm downloading this xcode 3.2.1 with iphone sdk 3.1.3 (it's like 3gb). I currently have xcode 3.2.1 with iphone sdk 3.1.2. What is the way to upgrade this, do I just install it and it'll install it over the one I have or something, is this even the right way to do this since I'm only trying to upgrade the iphone sdk?? Thanks in advan...

NSMutableArray Strings changing after reading in from file

I have a NSMutableArray that I create on program load. If the program terminates, I save the array to a file. Then when the app starts again, I check to see if this file exists and if so, read it in as the array. Problem is, on first creation everything is fine, I check an array object against a certain string and if it is equal, do...

Objective-C for iPhone - app crashing when using simple date commands

Hi everyone... I'm still learning Objective-C so forgive me if this is a simple amateur mistake, but I guess we all have to learn somehow. Basically I have an app with a simple bit of text, at the header of the screen, which has been IBOutletted and called 'headerText'. I want this to read "Summary for February", replacing February wit...

How to recognize Touch Up Inside gesture from UITouch

I am making a grid view. It subclasses tableview and lays out multiple subcells (columns) per cell. That's all working fine. Now, I need to detect when an individual sub-cell is tapped. I have overriden touchesEnded in the grid view. Is there a way I can take that NSSet of UITouch objects and detect whether it was a touch up inside or ...

Do I need to uninstall Xcode when upgrading?

Or do I just install the new one on top of the existing one? ...

UIToolbar in UIScrollView fixed with UIViewController as scrolling as subview problem

Hi , i'm having a BIG problem that i don't know how to solve... my UIToolbar that is supposed to be fixed @ the bottom of the screen , appears scaled thorugh all the screen. In my case i have: an UIViewController with an image scroling with an UIScrollView. so i need the toolbar on the bottom of the screen but instead , it replaces...

Getting started reverse-engineering OS X?

Hi, What is a good place to learn reverse engineering, specifically as it applies to Mac OS X? Two apps that I admire in terms of this subject: Hyperspaces – http://thecocoabots.com/hyperspaces/ and Orbit – http://www.steventroughtonsmith.com/orbit/ Thanks guys. ...

How can a checkmark state be saved in core data?

Hello all, I have a list app where users hit the + button and enter in an item that they want to appear in the list and hit save. The table is saved with core data. The only problem is when the cell is taped I want a checkmark to be displayed. Ive enabled multiple selection with UITableViewCell *thisCell = [tableView cellForRowAtIndexP...

cocoa touch: rand() returning the same string

Here's my code: -(void)randommoves { NSArray *possiblemoves =[NSArray arrayWithObjects:@"R ",@"R' ",@"L ",@"L' ",@"B ",@"B' ",@"F ",@"F' ",@"U ",@"U' ",@"D ",@"D' ", nil]; NSMutableString *finalmoves = [[NSMutableString alloc] init]; finalmoves = [NSMutableString stringWithCapacity:0]; [finalmoves retain]; int i = 0; for (i=0; i<20; i...

Setting a UIWebViewDelegate programatically.

I am trying to build a custom control based on a UIWebView and compile it into a library for reuse. Everything was working just fine when I had the code all together in a single test app but I'm having some trouble setting up a the delegate for the view for a library. Of note, the sample app used interface builder and thus the delegate...

How to track a long hold in finger in iPhone ?

Hi, How could I track event like touch on iPhone screen for 2 seconds. Like in safari to save image for image added to a UIWebView.. ? Thank you and Kind Regards, Tharindu Madushanka ...

iPhone app crash logs -- How can I use them to debug my app?

I'm not an expert in programming in general. I can find my way around Objective-C and Xcode and build working apps with no huge problems but when BUGs arise I'm often lost as to where to begin. My app works fine on the sim but more often-than-is-comfortable it crashes on the device. I looked at the crash log to see if there was any clu...

iPhone -- Why doesn't touchesBegan fire on UIViews when alpha is set to zero?

Is there some optimization going on that removes the view or something? I still want it to recieve touch events even though I've made it transparent. Seems these events don't fire if alpha == 0 though. ...

Over-riding NSObject and adding a class variable

I am using the following code to perform a selector after a delay with multiple passed parameters: http://nifty-box.com/blog/2006/12/nsinvocation-cleans-code.html It works very well, but I need to extend this to support the equivalent of: [NSObject cancelPreviousPerformRequestsWithTarget:self] (target in this case would not be self, ...