objective-c

HTML email loses formatting after being sent from iPhone program

I'm using MFMailComposeViewController in the iPhone SDK to bring up the mail dialog to send an HTML formatted email. The contents of the message body is being read from an HTML file which is generated in the app and saved on the filesystem. The email looks fine in the send mail dialog and all of the CSS formatting is there. However, afte...

From my app, iphone call start immediately without asking confirmation

is that new in 3.1? ...

How can I filter an array based on the objects in another array in Objective-C?

I have an array of objects in a tableView. I want the user to be able to go to another page and select from a checklist of objects to filter the first array. How should I handle the data from the checklist? I am currently handling it as an NSMutableArray of selected objects. But then how do I filter the first array with the contents of ...

Can a category simultaneously implement a protocol?

If a category I'm creating for a class adds methods that also fulfill the contract set out by a protocol, I'd like to flag that category class as implementing the protocol, and thereby indicate to the Obj-C pre-processor that the class effectively implements the protocol as well. Example delegate (for clarity, thanks Ole!): @protocol S...

Graying out an NSWindow's content

I have an NSWindow with 2 NSViews (an NSSplitView and a custom NSView). Accessing the data to populate these views can take some time. During this period, I'd like to gray out the content of these views. My first approach was to have a black third NSView that covered the other 2 and achieve the graying out effect by changing its alpha ...

C function always returns zero to Objective C

I have an Objective C project incorporating a C file with some helper functions. I have a grave and very irritating problem trying to return floats from the C file. C file: float returnFloat() { return 10.0; } Meanwhile in an Objective C instance method: float x; x = returnFloat(); x is always 0.000000. Any ideas what I'm doin...

Obj-C: Difference between "Fairfield" and @"Fairfield" (with at string)?

I just had a ridonkulous typo in my iPhone app, answered here. Now I'm wondering about the @"..." notation. why this works: NSArray *someArray = [NSArray arrayWithObjects: @"Fairfield", nil]; and this does not (even though it compiles, it will throw an EXC_BAD_ACCESS): NSArray *someArray = [NSArray arrayWithObjects: "@Fairfield", n...

how i can implement a custom UIAlertview with a progress bar and a cancel button?

Hi iPhone application developers, I am developing an iphone application. This application allows a user to upload images to my server. I want to show the upload progress in an alertView. I need some example code to illustrate how to implement a custom UIAlertView with a progress bar. Thanks in advance. ...

How to get Interface Builder name from id

If I name a widget in Interface Builder, and then I write a method that receives click events on that button: - (IBAction)btnTouchDown:(id)sender { // how can you identify the button here, // if several different buttons map // their "Touch" event to this same function? // I know you can look at its text but that seems really cl...

Something like .NET's "tag" property for Interface Builder

I'm currently struggling to use UI elements in Interface Builder. I keep trying to do things "in the .NET way." I have several buttons that all map down their TOUCH event to the SAME FUNCTION: -(IBAction) onTouch:(id) sender { // do something with touch, DEPENDING ON WHAT BUTTON WAS PUSHED // I want to do something like if( send...

UITextField where to set clearsOnBeginEditing

I'm really used to VS where all properties are nicely listed in a big dialog. In Interface Builder I can find no such dialog. If I want to set the clearsOnBeginEditing field of a UITextField to FALSE, where is the best place to do it? Is there an interface to a control's properties in interface builder that I'm just missing? ...

collision detection function in objective-c/core graphics

Is there a built-in function to detect collision between two circles? I have used CGRectIntersectsRect(rect1,rect2) to find the intersection between two rectangles.But if I want to know in which axis x or y they intersect how will i find it? Is there a built-in function or do you have any other ideas? ...

Which Objective-C framework do I have to use to record my screen?

I'm already recording from my iSight from a python script using the pyobjc bridge and the QTKit framework. Which framework/device/... should I use to capture the video of my screen instead of the built-in iSight? P.S. I'm using Leopard (not Snow Leopard) and thus I don't have the Quicktime X API at my disposal. ...

Executing binary on iPhone

Hello there, I wonder how a can include an pre-compiled binary in an iPhone application. I can't compile it inside XCode, I can only have the binary compiled for arm. I tried the execve function, but always reports "Operation not supported", I thought it was something with file permissions, but even setting +x perm got the same error.....

What does the + mean on Mac Dev Center?

For example, NSString documentation has – initWithFormat: – initWithFormat:arguments: – initWithFormat:locale: – initWithFormat:locale:arguments: – initWithData:encoding: + stringWithFormat: + localizedStringWithFormat: + stringWithCharacters:length: + stringWithString: + stringWithCString:encoding: + stringWithUTF8String: So what doe...

Cocoa-Touch: How to set the interpolation quality to be used by a UIImageView?

I have a UIImageView showing a image that is larger than it's frame. It's set to rescale the image to fit it's frame. But, the image is scaled with a low quality filter. I've read here that this is caused by it using a low interpolation quality. How can I get it's context to CGContextSetInterpolationQuality to kCGInterpolationHigh? ...

Property Lists - Reading and Writing (iPhone)

Alright, here goes. I'm making a very basic app, and I want the user to be able to store information between sessions. Basically, for them to save their game. There are only 7 Variables I need to save, all of them in are Integers. This is the code I have to save the game. - (NSString *)dataFilePath { NSArray *paths = NSSearchPathFo...

How to get the text value of an object?

How do I get the text value of an object in order to display it in a table? Other posts say objects are not NSStrings and you need to ask the object for its text. But how? The error is this: * Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '* -[Names isEqualToString:]: unrecognized selector sent to...

Accessing Method from other Classes Objective-C

Looked for an answer for this question, but I haven't found a suitable one yet. I'm hoping you guys (and gals) can help me out! (This is for an iPhone app) Alright, I have a Mutliview application. Each view has it's own class, and everything is happy. However, the different classes sometimes call the same method. Up until now, I ha...

Help getting dataSource working on OpenFlow

I need help getting dataSource in OpenFlow. I I want to provide CoverFlow functionality whenever the phone is turned horizontally. I'm using Alex Fajkowski's awesome code OpenFlow ( http://fajkowski.com/blog/2009/08/02/openflow-a-coverflow-api-replacement-for-the-iphone/ ) but the example provided is very different than what I need. I...