Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 06-27-2011, 02:59 PM   #1 (permalink)
Registered Member
 
Join Date: Jun 2011
Posts: 3
jo5729 is on a distinguished road
Default UITextView appropriate for a status window?

I'm trying to create a status window that would display logging information similar to the following:

Code:
27-JUN-11 01:12     Request Sent
27-JUN-11 01:12     Response Received: 200/OK
27-JUN-11 01:14     Request Sent
27-JUN-11 01:14     Request timed out
27-JUN-11 01:14     Request Sent
27-JUN-11 01:14     Response Received: 202/ACCEPTED
.
.
.
is a UITextView appropriate for this? Is there something better?

I have one view with a view controller (and view) that is posting the requests, and a second view controller (and view) that is running the log window. There is a root view controller with a tab bar controller that allows the user to switch between them.

Also, should I write the log messages directly to the UI element, or should I write the responses to a log object, and bind the log object to the UI element? I am not exactly sure how to do the latter method, using objective C, so any help there would be appreciated.

Thanks!
jo5729 is offline   Reply With Quote
Old 06-27-2011, 03:44 PM   #2 (permalink)
Senior Member
iPhone Dev SDK Supporter
 
Join Date: Jan 2010
Location: Issaquah, WA
Age: 42
Posts: 1,244
dljeffery is on a distinguished road
Default

I've thought about adding a log view into an iOS app as well (business app) and my planned approach is:

1) write log entries into the (existing) database via Core Data
2) use a UITableView for display of the data

Unless your log is very short, I don't think that using a UITextView would be a good approach. And using a UITableView will be a very easy approach if your logs are either in a database or a transient array. (I don't know if you care about maintaining the log between sessions or not; I do, personally, hence the use of the database.)

In any case, set up a log object; don't try to write directly into the view across controllers.
__________________
Recall It! Tag your notes. Tag your photos. Tag your thoughts. Tag your life.

Recall It! for iPad

http://www.dljeffery.com
dljeffery is offline   Reply With Quote
Old 06-27-2011, 05:00 PM   #3 (permalink)
Registered Member
 
Join Date: May 2010
Posts: 140
MatthewD is on a distinguished road
Default

UITextView should work fine. You'll probably want to update the UITextView after resetting the text to scroll to the bottom.

To bind the log object to the UITextView, I recommend looking into Key-Value Observing.
MatthewD is offline   Reply With Quote
Old 06-30-2011, 06:10 PM   #4 (permalink)
Registered Member
 
Join Date: Jun 2011
Posts: 3
jo5729 is on a distinguished road
Default

Quote:
Originally Posted by dljeffery View Post
I've thought about adding a log view into an iOS app as well (business app) and my planned approach is:

1) write log entries into the (existing) database via Core Data
2) use a UITableView for display of the data
I'm liking this approach, but I know I do not have the iOS experience to design and develop this correctly. I've got a prototype going on the side to learn, but I'd like to get a solution quicker.

I posted an ad on the jobs forum to see if I could hire someone experienced to help me design and implement this (correctly!), and if we can do it generically enough, open source it.

It seems like it could be a compartmentalized problem that a open source solution (similar to the ASIHttp project) could address to make everyone's life a little easier, similar to how log4j works in Java.
jo5729 is offline   Reply With Quote
Reply

Bookmarks

Tags
logging, uitextview

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 329
8 members and 321 guests
chemistry, Dnnake, iOS.Lover, lendo, leostc, Leslie80, pbart, VinceYuan
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,664
Threads: 94,120
Posts: 402,898
Top Poster: BrianSlick (7,990)
Welcome to our newest member, Leslie80
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 02:29 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0