objective-c

Rewriting a returned pointer to an output parameter

I'm playing around with the openSSL library and it requires me to brush up on pointers, and I'm having difficulty. I have a objective-c method: -(unsigned char *)encryptTake1:(unsigned char *)input inputLength:(int)inLen outputLength:(int*)outLen; It takes some data, encrypts it and returns a pointer to the data and the length of the...

Beginning mac software development

i recently downloaded the iphone sdk which came with xcode. what i wanna know from ur experience is that aside from iphone development is app development for mac making any money from anyone? ive been a web developer for a long time and wanna get into software development primarily on apple devices. what type on applications are in deman...

Using the netinet functions on iPhone causes the UI to not refresh

I'm including the netinet headers and doing some raw socket programming on the iPhone, and have found when making these calls, the UI won't refresh until I'm finished- any response I get and write to the UI, isn't written until the IBAction that made the call is complete. Using performSelector with a delay, I've been able to work around ...

How to pass a value from Cocoa to an SQLite query

Hi, first of all please let me say that I am quite new to objective c development. I am writing a small app for personal use for the iphone, but I have some problems executing the following code: NSString *sql = [[NSString alloc] initWithFormat:@"select color_r, color_g, color_b from Calendar where ROWID = %@", [calendarsID objectForKe...

iphone Development - analyze error

NSString *temp = [self randomBallPick:temp]; the following error: Pass-by-value argument in message expression is undefined why? -(NSString*) randomBallPick:(NSString*) oneFilename { //create an array of filenames NSMutableArray *imageArray = [[NSMutableArray alloc] init]; for (int c=0;c<37;c++) { NSString *imag...

Finding memory leaks while running iPhone unit tests.

I know how to do Unit Test on iPhone - the logic tests which run during build phase of the "iPhone Unit Test Bundle". I know how to detect memory leaks using instruments - in XCode, Menu->Run->run with perf tools->Leaks. How do I do both? I want to run the unit tests and detect memory leaks in them. If I try to simply select unit-test ...

Serializing objects in Objective C

When a user uploads something via my app, I create an ASIFormDataRequest object to make the POST. When the user is offline, I would like to write a ASIFormDataRequest object to file and send it later. Is there a built in way to serialize an object like this in Objective C, or do I have to write something from scratch? ...

How can I send two arguments in a selector method?

In the following, how can I send two arguments in togButton method? I tried, but it did not work. [button addTarget:self action:@selector(togButton:) forControlEvents:UIControlEventTouchUpInside]; ...

Return in Objective-C

What is the use of returning an integer for main in Objective-C programs. ...

MFMailComposeController error in Line Location tool

-(IBAction)shareList:(id)sender { MFMailComposeViewController *controller = [[MFMailComposeViewController alloc] init]; controller.mailComposeDelegate = self; [controller setSubject:@"Share Shopping List "]; [controller setMessageBody:@"Friend Shopping List Table" isHTML:NO]; [self presentModalViewController:controller animated:YES]...

how to use NSRunLoop in objective-C ?

Hi all, how to use how to use NSRunLoop in objective-C and wait for some variable to change value ? Thanks ...

What is the best way to organize a group of groups in Obj-c?

I have an unusual problem where I have a list of fruits (apple, orange, banana, grapes, etc etc). They can be organized into small groups for example: Group 1: apple, green_apple, pineapple Group 2: grapes, banana, strawberries, apple Group 3: orange, grapes, green_apple Each group is then associated with a price. So Group 1->9.99, Gr...

making a string bold in Cocos2D is harder than Cocoa?

Hi everyone I know in Cocoa to make a string bold is using this myLabel.font = [UIFont boldSytemFontofSize:16]; but what about in Cocos2D? I can't find any method to make the string bold Please help me out Thanks ...

detecting heartbeat peakpower using iphone sdk?

Hello all, i want to detect heart rate using iphone sdk does someone knows any method for calculating heartbeat rate? ...

How to read the content of an other app's text field on OS X?

For a project I must create a little buddy app that will read the content of one of the main app's text fields. Is there a way to get to the contents of a window/control (I'm interested in the text of the text field) on OS X? Something like GetDlgItemText() on Windows where I just pass the control's global handle and will get the contr...

More Detailed Error From createFileAtPath?

Is there anyway to get more detailed error data back from "createFileAtPath" I was kind of expecting an NSError? Currently I am using the BOOL return value. success = [fileMan createFileAtPath:fileOnDisk contents:dBuffer attributes:nil]; if(success == YES) NSLog(@"FileCreated"); else { NSLog(@"ERROR: Failed to create file"); ret...

How to convert a NSString to UTF-8 format string in iphone sdk?

I have localization in my app(english,spanish,italian).The client sent me strings files but some characters are strange how do i correct them? i have figured out that the client used Mac OS Roman encoding how do i convert this to utf-8. for example Nürnberg is converted into N√ºrnberg when client send me now i want to reconvert it. ...

detect when shakes an iPhone

hi, i have questions regarding the shake detection that posted here before, here is a reminder: "Now ... I wanted to do something similar (in iPhone OS 3.0+), only in my case I wanted it app-wide so I could alert various parts of the app when a shake occurred. Here's what I ended up doing. First, I subclassed UIWindow. This is easy pea...

How to implement an NSTextView that performs on-the-fly markup to RTF conversions

I'm trying to build an NSTextView that can take "marked up" input that is automatically translated into beautiful RTF-style text while the user types. The idea is to let the user enter text in "plain text" format, but to "beautify" it on the spot, e.g. H1 A quick list: * first item * second item would be translated into a first line ...

Displaying percentage using NSString

How do we display percentage character in objective-c? I am using this: [NSString localizedStringWithFormat:@"%.2f %", percentageQs] But for some reason, it doesn't recognize the %. thought i could escape it using this \ but i was so wrong. ...