Try the search, it's linked to some great forums

Showing posts with label tricks. Show all posts
Showing posts with label tricks. Show all posts

Friday, June 6, 2014

CoreData, SQLite and terminal Shtuff

These are some simple commands that can be used in terminal to manipulate data & files

Unix commands:
ls       list files
cd      change directory (directories should have NO embedded spaces for this Unix cmd
md     make directory
cd ..   up a directory help duh?

link for command tool UNIX commands - http://www.cs.colostate.edu/helpdocs/vi.html

sqlite3 commands:
sqlite3 filename.db   Opens the filename database
.help                          guess what

Xcode commands: 
-com.apple.CoreData.SQLDebug 1   Add as a schema argument to allow debugging of SQLite code
            goto Product/Edit Schema/Run app/Arguments/Arguments passed on Launch

Friday, January 11, 2013

Memory leaks

Even with ARC (Automatic Reference Counting) an app can have memory leaks which can totally foul up an app.  Typical signs of leaks include;
  • slowing of the apps animation, view transitions, etc
  • locking up the app and or device (see Turning off your locked up iPad)
This post is a quickstart guide for using Xcode's Instruments specifically  to find those leaks.
From within Xcode;
  • Select Xcode-Open Developer's Tools-Instrument
  • Then select your instrument from the popup - Leaks in our case
  • Size the Allocation & Leaks strip charts appropriately and
  • from the List box in the upper left select Choose Target-appName on the device
  • Press Record n Stop button to start & stop the app
Allocations should reach some level & then stop.  If you have leaks they show as red bars, and the allocations count will keep rising.  You can isolate where the leaks are by looking into the stack when the leaks occur.  Fix and rerun the app.

Apple's Instruments User Guide is the place to start learning about these tools. Also see the Xcode 4 User Guide to use with Xcode.

Within Xcode the call stack can be investigated from the Debugger toolbar as in this snapshot


 Stepping back thru the vertical call stack can give an indication where the code failed.