objective-c

Debugging unexpected error message - possible memory management problem?

I am trying to debug an application that is throwing up strange (to my untutored eyed) errors. When I try to simply log the count of an array... NSLog(@"Array has %i items", [[self startingPlayers] count]); ...I sometimes get an error: -[NSCFString count]: unrecognized selector sent to instance 0x1002af600 or other times -[NSConc...

Automatic screenshot uploading on Mac like Cloud App

Cloud App has this neat feature wherein it automatically uploads new screenshots as they are added to the Desktop. Any ideas how this is done? ...

Objective-C global array of ints not working as expected

In my MyConstants.h file... I have: int abc[3]; In my matching MyConstants.m file... I have: extern int abc[3] = {11, 22, 33}; In each of my other *.m files... I have #import "MyConstants.h" Inside 1 of my viewDidLoad{} methods, I have: extern int abc[]; NSLog(@"abc = (%d) (%d)", abc[1], sizeof(abc)/sizeof(int)); Why does i...

Basic Profanity Filter in Objective C for iPhone

How have you like minded individuals tackled the basic challenge of filtering profanity, obviously one can't possibly tackle every scenario but it would be nice to have one at the most basic level as a first line of defense. In Obj-c I've got NSString *tokens = [text componentsSeparatedByString:@" "]; And then I loop through each to...

NSStringFromPoint disappears under Objective-C++

The function NSStringFromPoint disappears when I compile my code using objective-C++, but it's fine under objective-C. How can I make objective-C++ see that function? If I compile under Objective-C++ it says: error: 'NSStringFromPoint' was not declared in this scope error: 'NSStringFromRect' was not declared in this scope error: 'NSEq...

Calling self in objective c method headers

Lets say I made a method that can tabulate the total of x and y. total = [self totalThemUp x:30 y:50]; Is self correctly used? Why so? I don't see any object in particular that is acted on. Thanks for your help! ...

How to insert/update multiple record into SQLite database in a single query.

Hi Guy. Is it possible to insert/update multiple record in SQLite database using EGODatabase wrapper. If I'm correct I think we can do it with FMDatabase by wrapping it between [db beginTransaction] and [db commit]. I wonder if we can do the same thing by using EGODatabase. Following is the code sample from FMDatabase project: [db be...

how to put the gps new cllocation co-ordinate to google map in objective-c.

i want to use the gps to update the user location on google map,i am using the following method. -didFailWithError and -didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation but how can i get the newlocation on the google map, because for that we want the latitude and longitude. and then put that in setr...

AVAudioPlayer problem regarding song overlaping in iPhone

I have using AVAudioPlayer in my app but the problem is that when i play the song from list it will played while before stopping the song i am again goes to song list then select another song then both song will start playing simultaneously so please tell me the code which will terminate my first song. i am using avTouchContoller & avTou...

Encrypting passwords.

My iphone application wants to connect to server by giving username and password. How can I send this password securely. Anyone please help. I am a beginner. ...

How to make a command-line tool executable in OS X?

I just finished writing my very first command-line tool in Objective-C, compiled it, and now I'm curious about how one would go about making it executable as a command. For example, right now to use the program I have to type in ./filename -args into Terminal. I'd like to be able to only type in filename and execute the program. I tri...

Problem with the dateformatter's in Iphone sdk.

Hi guys, Here I had a problem with the date formatters actually I had an option to search events based on the date.for this Im comparing the date with the date store in the database and getting the event based on the date for this I wrote the code as follows: -(NSMutableArray*)getSearchAllLists:(EventsList*)aEvent { [searchList remo...

Spanish characters replaced with weird string when 'stringWithFormat' is used?

NSString *myString = [NSString stringWithFormat:@"%@",BernabÈu]; NSLog(@"%@", myString); Above statement prints: Bernab\u00c8u Here 'BernabÈu' is Spanish character string. Why is the "\u00c8u" appended? How to get rid of it? ...

Application frame leaves blank line at the top

Any clues why my programmatically defined UIScrollView (using the application frame) always leaves an empty space at the top (below the navigationBar) of 20 pixels. How can I close that? UIScrollView *vScrollView = [[UIScrollView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]]; vScrollView.backgroundColor = [UIColor redCo...

get the latest podcasts from itunes store with link by RSS, JSON or something

Hi out there, i'm trying to get the latest podcast informations out of "itunes store" to work with this data in several applications (iphone app and web app). Is there a way to get this informations? RSS, JSON or something? i want to work with this informations in objective-c and on a website with php or js. Is my question clear? :(...

How to compare 2 objects for equality in Objective-C

In Java you can write an if statement like this: if(object1.equals(object2)){ // Do something.... } How can I code the same logic in Objective-C? I basically want to compare 2 of any one type of objects, such as 'Text Fields', 'Text Views', etc. Thank you. Shakeel ...

UIPicker EXC_BAD_ACCESS after repeated usage

i populate uipicker's datasource from array built with sqlite database stored data. everythiongs works fine.. for a little while. after 6-7 spinnings, the picker freeze, and I get EXC_BAD_ACCESS. debugger indicates the program stopped in the main () function. so, how could this happen? working for a while, and then, suddenly exit like t...

How to adjust the height and width of the webview controller so that the whole text is displayed within the view.

Hi, I need adjust the height and width of the webview controller so that the whole text is displayed within the view and the user need not scroll to read the text.I am not getting how to do this. Please any one help me to solve this. Thanks in advance. ...

how to read the fields in the object that is store in the array in objective-c

my appdelegate is having the array book, this array is storing the many object like latitude and longitude coming from server. this object are containing the many latitude and longitude values coming from server. values coming from the sever is store in the object file booknew and then this objects are stored in the array. how can i r...

How to read XHTML file tags using Objective-C?

Hi, I want to read XHTML tags and text separately using objective C. what approach I have to follow? ...