How do I debug with NSLog(@”Inside of the iPhone Simulator”)?

There’s a far more convenient way to trace with log messages in Xcode, and that’s using Breakpoint Actions. On the line of code where you’d be tempted to add a printf or NSLog, set a breakpoint, then control-click it and choose “Edit Breakpoint”. In the blue bubble that appears, click the + button on the … Read more

iOS AutoLayout – get frame size width

Actually, above answers are not quite right. I followed them and got zeros again and again. The trick is to place your frame-dependent code to the viewDidLayoutSubviews method, which Notifies the view controller that its view just laid out its subviews. Do not forget that this method is called multiple times and is not the … Read more

iOS 10 doesn’t print NSLogs

It could be that you added the property “OS_ACTIVITY_MODE”: “disable” in the Scheme environment variables (to hide OS output from the simulator) and forgot about it, and now are running on a real device. In Xcode 8: Product -> Scheme -> Edit Scheme -> Run -> Arguments -> Environment Variables Only add OS_ACTIVITY_MODE and check … Read more

Warning: “format not a string literal and no format arguments”

Xcode is complaining because this is a security problem. Here’s code similar to yours: NSString *nameFormat = @”%@ %@”; NSString *firstName = @”Jon”; NSString *lastName = @”Hess %@”; NSString *name = [NSString stringWithFormat:nameFormat, firstName, lastName]; NSLog(name); That last NSLog statement is going to be executing the equivalent of this: NSLog(@”Jon Hess %@”); That’s going to … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)