objective-c

Merge 5 NSStrings in Objective-C

I have multiple NSStrings and i wish to merge them into one other, here is my code so far... NSString *newURL = [_parameters objectForKey:@"url"]; NSString *emailBody = @"Hey!<br>I just snipped my long url with <a href=\"http://itunes.com/app/SnippetySnip\"&gt;Snippety Snip for iPhone</a> in just a few seconds, why not check it out?<p><...

dataDetectorTypes phone link issue

Hello, this is a reformulation of this question When i set myWebView.dataDetectorTypes = UIDataDetectorTypeNone; phone links (in a href html tag) are handled like this : How can I handle phone links with the shouldStartLoadWithRequest delegate method instead? ...

is there any system or library that can intelligently assign text from array to specific fields in iphone

HEllo, I have a situation here i have contents(NSStrings) in an array, is there any system or library that can assign the content of array to specific fields. Please help if you have an idea about this. Thnx in advance (ok to elaborate) say I have standard of a student then allocate it to standards text field corresponding to standa...

Generating a computer-specific UUID in Xcode

How do I generate a UUID that will uniquely identify a computer using Xcode / Objective-C? Windows has UuidCreateSequential(), what can I use on a Mac? ...

Monitoring background Threads

I am trying to monitor a thread that i set running in the background. I need to be alerted when it is finished executing. - (IBAction) btnGreaterTen_clicked :(id)sender{ self.searchDistance = [NSNumber numberWithDouble : 10]; CGRect frame = CGRectMake (120.0, 185.0, 80, 80); activity = [[UIActivityIndicatorView alloc] in...

Cleanest way to create multiple NSDocuments from NSData

Hi, I am writing a document based application on OS X. One feature oft this application will be an "import" function. This function will read data files from the disk which contain data as raw BLOBs and can be parsed into one oder more documents. For this function I will have to create documents programatically. The main problem is, th...

I want to record and play the audio with iphone but not through microphone ..?

I want to record the user's voice without using the headphone. I want to record it directly by iPhone and play it directly by speaker. Is there any way to do this? ...

iPhone code - using image in UIButton?

hi, i want to use an image in a UIButton buttonHeader background, when i compile it i get an error that buttonHeader is not an image type, what property to use? - (void)downloadImageHeader { NSMutableURLRequest *requestWithBodyParams = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"http://www.../imageHeader.png"]]; N...

memory access error when releasing a newly created object

I'm having an issue understanding why releasing an object that I just created is causing a memory access error in my application. I'm creating a bunch of objects and adding them to an NSMutableArray. After I add them to the array, I release them. The first time the function runs, things go smoothly. The second time the function runs,...

Objective-C dot syntax or property value?

I keep reading that dot syntax is possible but I keep getting errors that the struct does not contain members I am referencing. Perhaps its not the dot syntax so I have included details of what I am doing in hopes of a solution: // MobRec.h - used as the objects in the MobInfo array #import <Foundation/Foundation.h> @interface MobRec...

Using Array Controllers to restrict the view in one popup depending on the selection in another. Not core data based.

I am working on an app that is not core data based - the data feed is a series of web services. Two arrays are created from the data feed. The first holds season data, each array object being an NSDictionary. Two of the NSDictionary entries hold the data to be displayed in the popup ('seasonName') and an id ('seasonID') that acts as a p...

iphone code - CGPoint question

hi, i have 10 moving objects (UIImageView), is there a better way to write this code? - (void) jumpOnTimer { jumpBall1.center = CGPointMake(jumpBall1.center.x+pos1.x,jumpBall1.center.y+pos1.y); if(jumpBall1.center.x > 60 || jumpBall1.center.x < 0) pos1.x = -pos1.x; if(jumpBall1.center.y > 211 ||...

Error building release target with Growl framework included

I just addred Growl integration to an Xcode application. The source compiles and runs correctly under the Debug target while testing. When I try to build the Release target however, I get the following error and I'm not sure why, or whoe to resolve it. Building target “EchowavesNotifier” of project “EchowavesNotifier” with configura...

Why does the XCode debugger output not match what I expect, when interrogating UIButton values?

This screenshot explains it all: The screenshot shows the debugger reporting buttonType as 2 but the console showing button type = 0. The same variable is being shown in the debugger and the console. Any idea how this mismatch happens? (gdb) po ((UIButton *)control).buttonType There is no member named buttonType. As requested:...

iPhone: How to get data from a web application?

Sorry if this is a stupid question, but I am new to this. I am getting started with iPhone application development and would like to create an application that involves pulling data from from a web application. Let's say the url is http://myapp.com/api/people/fetchall and it returns XML data. How do I get this data into my iPhone App...

Weird Touch Point value returned when used with scroll view controller

My application attaches a list of UIView controllers to a scrollview controller. As a part of requirements, it is needed to make some of the elements in the individual view controllers clickable. But, if I use a touch point, I get weird cooridinate values like (0,12567234). Is there a way to obtain the actual touch point value? My code l...

iPhone: How to populate a table view from XML data?

Let's say I have XML data that I just downloaded from a web app api. How do I parse the data? How do I populate each cell of a table view with this data? ...

NSMutableDictionary thread safety

I have a question on thread safety while using NSMutableDictionary Main thread is reading data from NSMutableDictionary where key is Nsstring value is UIImage Async thread is writing data to above dictionary (using NSOperationQueue) how do I make above dictionary thread safe Should I make Property NSMutableDictionary as "Atomic" or ...

Problem accessing relationship objects in an NSManagedObject

My managed object has a relationship called items. My subclass has a method called itemCount. Unfortunatly my attempts to get the object count in the items relationship always returns 0. Here's the relevant code: @interface List : NSManagedObject {} @property (nonatomic, retain) NSSet* items; @property (nonatomic, readonly) NSNumber * ...

Not feasible to call NSInvocation from a SenTestCase derived class?

Is NSInvocation class not meant to be called via unit tests (for iPhone)? My intent is to call a class's method generically and since the method has more than 2 parameters, I can't use [myTestClass performSelector:withObject:withObject] Instead, I'm trying to use NSInvocation but as soon as I try to instantiate from NSInvocation class,...