Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tweaking parameters at runtime? [duplicate]

When working with iOS, I sometimes have values I need to test with. I may adjust these values 30 times, and have to rebuild/rerun 30 times to test them. This is an obvious hassle.

So I was wondering (using the iOS SDK) if it was possible to tweak small parameters/data at the app's runtime? Just to make life convenient.

like image 296
MCKapur Avatar asked Apr 09 '26 00:04

MCKapur


1 Answers

  1. Set a BreakPoint
  2. In lldb debug area type:

Example 1:

expr (void)[aView setBackgroundColor:(UIColor*)[UIColor redColor]]

Here, aView is an UIView for which I want to see its frame at runtime. I am calling the setBackgroundColor method of an UIView at runtime. Any method could be called like that.

Example 2:

expr nsstringVariable = @"yourRunTimeValue"

Here, I am changing a string variable at run time.

For more help on expr type

help expr

I highly recommend people to read this tutorial by Brian Moakley Intermediate Debugging with Xcode 4.5

like image 144
Warif Akhand Rishi Avatar answered Apr 11 '26 18:04

Warif Akhand Rishi



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!