objective-c

Selector being performed when trying to set UITextField text

Hi, i'm trying to clear a UITextField whenever the UIControlEventEditingChanged event is being performed. However, when I set the text to nothing, the UIControlEventEditingChanged event is being called again, and this is the way it keeps going. This is my code: - (void)updateText { //other code textfield.text = @""; //othe...

What kind of loading screen should I have

I'm making a navigation based application. When the user selects a row on the table view, it goes to the next table. However, depending on how many entries are on the table view, this can be instantaneous, or it can take a while. Something needs to be shown to the user that the program is working and is not frozen. I was thinking of br...

iPhone gamecenter submitting highest score?

Hi, I am using below function to submit score to game center. How to modify below code so that i can send the score only if it is highest than already submitted score. And i dont want to maintain the scores locally. Any help? - (void) reportScore: (int64_t) score forCategory: (NSString*) category { GKScore *scoreReporter = [[[GKScore...

Programmatically save causes document to think other app changes doc when re-opening file

This is pretty weird and I would very much appreciate all help =) I have a document based app where it should be possible to perform some actions on the document file. To do so I'm saving the document every time the document actions are called. To do so I'm using the method: saveDocumentWithDelegate:didSaveSelector:contextInfo: Th...

Catch all Objective-C messages and get list of objects in Cocoa runtime.

Hi Peoples, I need to catch and log all messages sended by objects in Cocoa app. And also I need list of object instances in runtime. It's is posible? ...

Expected function body after function declarator error

I downloaded the class files and demo program here: http://github.com/matej/MBProgressHUD When I try to compile the program, I get several errors. The first one appears here: CG_EXTERN void CGPDFContextAddDocumentMetadata(CGContextRef context, CFDataRef metadata) CG_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_0); On the second line t...

Reading in text document from a server

I want to be able to store a text document on a server and then read this document when my app launches. I would want to read e.g. a description for an object and item number, and a few urls to images and sound clips. Is reading in and parsing a text document the best way to do it? If so how is it done? Thanks ...

How to set the UISegmentControl as selected and multiple touches for selected index?

Hi Guys, I have one problem :I have UISegmentedControl with three indexes 0,1,2. when i select the index of UISegmentedControl it is working fine but I need to have multiple touches and it should be focued How it can be achieved. how can be programed for Tapping the selected index again and it should work... NSArray *segmentTextC...

Best way to download a website

Hey. I am currently using [NSString stringWithContentsOfURL:url] to download the contents of an external webpage to my app. Is there any other way that might be faster or better/safer? ...

how to handle music code ?

hello all assume u r write a code for a piano instrument. Is a good way to make for every button IBAction or all buttons in one function return the sound clicked by the user thanks all ...

Integrate calender into application for iOS

Hey, I wondered if anyone knows if its possible to use the functionality of the calender within an application similar to how you can use the MapKit inside your application. Thanks, William ...

how to set custom method with rightnavagation Button in NavBar.

Hi all. I want set my custom method "Home" with RightNavagation button how should I? My code UIBarButtonItem *barButton = [[UIBarButtonItem alloc] initWithTitle:@"DontWorryAboutThis" style:UIBarButtonItemStylePlain target:self action:@selector(home:)]; [barButton setImage:[UIImage imageNamed:@"home_btn.png"]]; [self.navigationItem s...

Communicating computer to computer over internet

Is there a sample app out there that has communication between 2 computers? For example: Both computers have an objective-c app, both send messages back and forth. And both computers are in different countries. ...

why the volume of sounds does not change in my app ?

Hello everyone i used code below in my application and if i increase or decrease the volume from the iphone's button it still the same but if the phone in silent mode the voice will be muted the code: -(void) playNote: (NSString *)Note type: (NSString *)type { CFURLRef soundFileURLRef; SystemSoundID soundFileObject; ...

Landescape view always in one view

Hello all, my app run in landscape mode i want it to be always in one form i.e suppose the background is stackoverflow picture in this case stack will be beside the ear speaker and flow beside home button i want when the user rotate the iphone 180 degree (still landscape mode) now flow will be beside the ear speaker and stack beside hom...

Memory management - how best to initialise an instance declared in the header

I've read a few posts on this, but there's still one thing that's not clear for me. I know this might be rather a n00b question, but I've actually got rather far into development without quite grasping this fundamental issue. A symptom of being self taught I guess. You declare a variable in your header, like so: @interface SomeClass ...

If I have a UIViewController in a UIScrollView how can I programmatically make the UIScrollview zoomToRect?

I have a scrollview that has a page control. The scrollview contains 3 views. Each view contains a view controller. In one of my view controllers I press a button and I want the scrollview to scroll to a specific location. But Im not sure how to accomplish that since the button is not in the UIScrollview but in one of the view controller...

iOS: Sending Attachment with MFMailComposeViewController, arrives as "Part 1.2"

I'm trying to send an NSString as an attachment using MFMailComposeViewController. When I open the Mail I just have a "Part 1.2" Attachment. Here's the code used: MFMailComposeViewController* controller = [[MFMailComposeViewController alloc] init]; NSMutableString* writtenWillItBe=[NSMutableString stringWithFormat:@"...",...]; [contro...

Trying to loop through an array and total up NSDecimalNumbers

I have the following code: - (NSDecimalNumber *)totalBudgetItems { NSEnumerator *e = [self.defaultBudgetItemsArray objectEnumerator]; id object; while (object = [e nextObject]) { NSDecimalNumber *numberToAdd = [[NSDecimalNumber alloc] initWithDecimal:[[object objectForKey:@"actualValue"] decimalValue]]; curre...

Integers in IPhone App

Hi! I have a button in my App called myButton, what I what to do is really simple. I want to have an integer that adds one to itself every time the Button is pushed. Here's what the code looks like right now: - (IBAction)myButton { NSLog(@"Button was pushed WOHHOP"); } This is inside my .m file, so do I need to declare an integer i...