objective-c

How to fade any sound when your app wants to start?

Is there any method to fade sounds like iPod music when the user want to use your app? Thanks. ...

Dealing with objects from different classes

I have 3 classes of objects. All 3 classes share some properties in common, as color, text, etc. For example, I can have this Class1 *objectA = [[Class1 alloc] init]; objectA.myColor = [UIColor redColor]; Class2 *objectB = [[Class2 alloc] init]; objectA.myColor = [UIColor redColor]; Class3 *objectC = [[Class3 alloc] init]; objectA.my...

If a website doesn't have an API - what to do?

There is a website called: Engrade.com. It's pretty cool, you can monitor what your grades are in your current classes. But I want to make an objective-c app that can log in as me and get my grades. Then probably, it would alert me to any bad grades, ect. Problem!!! It doesn't have an API, so I'm stuck. Does anyone know how I would d...

cannot read a readonly property, compiler complains.

Hi, I'm new to Objective C, but have extensive C++ experience. I have a member variable called bOn, which I have declared as a readonly property. I then synthesize it. However, the compiler won't let me read it, saying "Instance Variable 'bOn' is declared protected". I would understand this error if I had not synthesized. Here are my...

- (NSString *)instanceMethod

Dear iPhone Developers, I have an instance method which is meant to return a string - (NSString *)newFile:(NSString *)inFile andFileNumber:(NSInteger)aNumber { return [NSString stringWithFormat:@"%@.o%i",inFile,aNumber]; } I call this method as outputFileName = [self newFile:inputFileName andFileNumber:newNumber]; // where input...

Problem rotating UIImage

My code below, anyone know what is happening? Sorry about the incomplete information, the image just desapear! - (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info { UIImage *imCaptured = [info valueForKey:@"UIImagePickerControllerOriginalImage"]; CGImageRef cgirCro...

periodically check value of UITextField

I have a scanner that is reading text into a UITextField, looks like it is one character at a time. So every 1/2 second or so I want to check the value of that UITextField so I can grab the value. ...

Objective-c: Problem with CGRect .frame intersect/contains

I have two UIImageViews located about center of a horizontal screen and when the user clicks a button another UIImageView, located off screen, slides in from the right. I'm am just trying to detect when the view being brought onto the screen collides with the two static views. The problem is when I run my code and check the CGRect frames...

Using setters / mutators in dealloc

To be specific, I'm talking about writing a dealloc like so: -(void)dealloc { self.myvar = nil; [super dealloc]; } I understand this goes against Apple's recommendations. I also understand that it can cause issued with KVO as well using the setter on a partially deallocated object. But if I'm making the calls in this order ...

NSDateFormatter returns a date off by a day

In my iPhone app, I am trying to get the EEE MMM dd from a date string received by a web service. For all dates where time is < 07:00, the NSDateFormatter returns a date off by 1 day. For example: Date to format: 2010-11-17T05:00:00, formatted date result: Tue Nov 16 Here's the code snippet: NSDateFormatter *dateFormat = [[NSDateForma...

iphone - moving a UIImageView

I'm having difficulty moving an image to another location after the first animation is finished. the image animates at a point that I've specified, then stops (that works fine). I would then like to move the image to another location and repeat. here's my code: -(void) loadTap { NSArray *imageArray = [[NSArray alloc] initWithObjects...

how to find out is a long string contatins a word obj c, iphone

I have a long string that has a running list of all the "words entered" in the text box. I want to be able to check the long string against a one word string to see if the long string contains the word in the short string. Any ideas? I've tried this and a few other things, where newString is the long string and currentTextrightnow is ...

incrementing a double is never whole.

I'n obj-c I have a timer fire every .1 seconds and increment a double value (seconds) by .1 So it should basically keep time counting up by tenths of a sec. When it fires it checks some if else statements to see if (seconds) is equal to 3, 9, 33 etc. but these are never triggered. I suppose it is because of the way doubles are represent...

Crash on CGPDFDocumentCreateWithURL

I get an EXC_BAD_ACCESS on this code: NSURL *pdfURL = [NSURL URLWithString:path]; pdf = CGPDFDocumentCreateWithURL((CFURLRef)pdfURL); CFRelease(pdfURL); 'path' is just an NSString path the the file I am loading from the documents directory. I have chanced to ensure the path is correct. I am also running on the simulator but I ...

Reducing the memory footprint of a function with a lot of autoreleased variables?

Hi, I'm still wrapping my head around some of the nuances of memory management in objective-C, and came up with the following case I'm unsure about: + (NSDecimalNumber*)factorial: (NSDecimalNumber *)l { NSDecimalNumber *index = l; NSDecimalNumber *running = [NSDecimalNumber one]; for (; [index intValue] > 1; index = [inde...

Setting the background image of iPhone from an app

I was wondering if it was possible to set the IPhone's background image from an App. I have an image which is a UIImageView. Like when the phone is locked theres the "wallpaper background image." Is there a way to make a button which can set the wallpaper of the phone as my UIImageView? ...

How to pass method arguments to a selector

If I have a method like this: - (void) foo { } Then I can access it through a selector like this: @selector(foo) But what if I have a method like this: - (void) bar:(NSString *)str arg2:(NSString *)str2 { } Then how do I access it through a selector? ...

Accessing an FTP connection for downloading files

i am new to iphone.. i want guidelines for accessing ftp server through objective c ,where ftp url, username,password should be given in program itself , i want to access a lot of image files from the ftp and display it in my imageview. how to store those image files in locally and retrieve whenever needed.... thanks in advance.. ...

Is there any control that can show photos like "Photos" in iOS?

Does iOS have any control to shows photos like the Photos application? I'd like a control to manage albums, photos, show an album list, and show photos, like the built-in Photos, or the Facebook app. ...

JSON response to C/C++ object and C/C++ objects to Java /Objective C

Hi, Is there any way to convert the JSON response to C/C++ object structure and,convert the those object (C/C++) objects back to java or Objective c. ...