nslog

Why isn't my method fully working? (iPhone SDK)

I have a method here that is in my code: -(IBAction) actionButtonPressed: (id) sender{ NSLog(@"%@",actionButton.titleLabel.text); if (actionButton.titleLabel.text == @"Begin Recording"){ [actionButton setTitle:@"Finish Recording" forState:UIControlStateNormal]; [actionButton setTitle:@"Finish Recording" forState:...

NSLog crashing app using 3.1.3 software

Hi guys - the other day I had a bug submitted for my app from a user on an ipod touch with 3.1.3 software. It was a strange bug as no-one else has submitted it yet. Long story short, it appears that anywhere where I have NSLog() in code it will actually crash the app. I tried stripping out ALL the code other than NSLog(@"hello") and ru...

How to nslog - copied text in iPhone?

Suppose - User has selected & copied some text in textField/textView/webView. Now I want to Log the copied text, But don't know how? How is it possible? Sagar ...

Storing and retrieving CGPoints inside NSMutableArray

I've looked through countless questions on here and elsewhere and cannot for the life of me figure out what I'm doing wrong. I'm trying to store an array of CGPoints as NSValues inside of an NSMutableArray named points like so on the iPhone: NSValue *point = [NSValue valueWithCGPoint:firstTouch]; NSLog(@"NSValue *point = %@", point); [...

Where did the NSLog go, when user download my Apps from App Store?

Can the Using enable to see the NSLog when they plug the device on their mac? or is this possible to see the NSLog from the user? ...

Objective C: Method have knowledge of context within which it was called?

I'd like to have a reusable logging method or function that spits out the name of the method it's called from. Example: - (void)exampleMethod { CustomLog(); //Outputs "exampleMethod" } ...

URL Encoding of Characters in a password field

I am trying to pass login credentials to a PHP script that I have in my iPhone app. When I pull a password with special characters the password is missing certain characters especially the percent sign. I am trying to encode the text but even before I send it, the percent sign is missing. //p_field is a UITextField holding the passwor...

iphone nsarray problem?

Okay maybe i just need another set of eyes on this, but I have the following lines of code in one of my view controllers. It takes some data from a file, and populates it into an array using "\n" as a separator. I then use that array to make an NSDictionary, which is used to populate a tableview. It's very simple. However it isnt working...

Objective C override %@ for custom objects

Hey there, I'd like to override the default print function in NSLog for custom objects; For example: MyObject *myObject = [[MyObject alloc] init]; NSLog(@"This is my object: %@", myObjcet); Will print out: This is my object: <MyObject: 0x4324234> Is there a function I override in MyObject to print out a prettier description? Ch...

Removing NSLog breaks compiler

Okay, so this is weird I have this code - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { switch (indexPath.row) { case 1: NSLog(@"Platform Cell Selected"); AddGamePlatformSelectionViewController *platformVC = [[AddGamePlatformSelectionViewController alloc] initWithNibNa...

How to dynamically build up the arguments for NSLog?

Example: I have a complex method that does a lot of stuff, and at the end I want to print a report with NSLog. NSLog wants a string, and then an arbitrary number of arguments. So lets say there are these possible values which can be logged: A B C D E F It can happen that -for example- C and D are not logged, but the whole rest. Ho...

How to NSLog with \n\r\t

Hello ! Every one. In my application I am reading an HTML page to a string. HTML Page contains many tags, new lines & many other characters. <style type="text/css"> h3{ font-weight:bold; line-height:18px; font-family:Arial; font-size:12px; text-align:justify; color:black; ...

How to redirect the nslog output to file instead of console.

I have cocoa application running on OS X. I have used NSLog for debugging purpose. Now I want to redirect the log statements to file instead of console. I have used this method but it results logging in Console as well as in file. - (BOOL)redirectNSLog { // Create log file [@"" writeToFile:@"/NSLog.txt" atomically:YES encoding:...

change speed of an array loop? Objective-C

I have this code NSArray *food = [NSArray arrayWithObjects:@"Apples:",@"bacon",@"corn",@"donuts",@"elfs",@"fidge",nil]; for(int i = 0; i<6; i++){ NSLog(@"item at index %i is %@",i,[food objectAtIndex:i]); } and right now they are all printed to the console instantly. How can I make a variable to decrease or increase the speed th...

NSThread to slow down Array being printed to console in Objective-C? so confused...

so I have an array with objects @"One", "Two", "Three", "Mouse" and I want to have each word of the array NSLog'ed to the console in half second increments. I also would like to be able to switch to 1 second increments instead. Can anyone please help me write this code. I'm new, but I need to understand this project. I was tipped that I...

NSString fails, app crashes trying to NSLog the NSError

What it says on the tin. All I want to do is save an NSString to a .txt file in my Documents directory so it can be accessed by the user. This is called in applicationWillTerminate: NSError* err; NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentsDirectory = [paths object...

iphone NSLog when displaying an array

Hello - Two part question: First when I am using nslog to log the contents of an array, why is it that some of the objects in the array (all strings) have quotation marks around them and some dont? The log will look like: "Item 1", "item 2", item3, "item4" This leads to my second part of the question... The array in question is bei...

NSLog without new line

Is there any function that does what NSLog does but without the new line at the end? ...

How to send NSLogs when a user presses a button or does something

Hello, I'm making an application for someone, and theres some things I'd like to monitor. I have NSLogs all set in place for each action, but I want to be able to send those to a console or something. Is there anyway of doing this? Also I don't want the user to know about it, I'm monitoring this because I gave the user a password for an ...

NSString and UITouch...what in the world is going on?

I have an error with NSString. In one of my .m files I have a member called "conversions" of type NSString and within a method of that class the string is manipulated and added on to and etc. Well, when I try to Log that string in a different method that is later called, for some reason the string is printing as a UITouch object. Specifi...