Featured post

c# - Usage of Server Side Controls in MVC Frame work -

i using asp.net 4.0 , mvc 2.0 web application. project requiremrnt have use server side control in application not possibl in noraml case. ideally want use adrotator control , datalist control. i saw few samples , references in codepleax mvc controllib howwver found less useful. can tell how utilize theese controls in asp.net application along mvc. note: please provide functionalities related adrotator , datalist controls not equivalent functionalities thanks in advace. mvc pages not use normal .net solution makes use of normal .net components impossible. a normal .net page use event driven solution call different methods service side mvc use actions , view completly different way handle things. also, mvc not use viewstate normal .net controlls require. found article discussing mixing of normal .net , mvc.

iphone - Cocoa Touch - Display an Activity Indicator while loading a UITabBar View -


i have uitabbar application 2 views load large amounts of data web in "viewwillappear" methods. want show progress bar or activity indicator while data being retrieved, make sure user knows app isn't frozen.

i aware has been asked before. need clarification on seems rather good solution.

i have implimented code in example. question's original asker later solved problem, putting retrieval of data "thread". understand concept of threads, not know how impliment this.

with research, have found need move of heavy data retrieval background thread, of ui updating occurs in main thread.

if 1 kind provide example me, appreciative. can provide parts of existing code necessary.

if use nsurlconnection runs on thread automatically.

in viewdidload:

nsurlrequest *req = [nsurlrequest requestwithurl:theurl]; nsurlconnection *conn = [nsurlconnection connectionwithrequest:req delegate:self]; 

then need custom methods. if type in -connection , press esc you'll see different methods can use. there 3 need this:

- (void)connection:(nsurlconnection *)connection didreceiveresponse:(nsurlresponse *)response {     // called when there response         // if you're collecting data init nsmutabledata here }  -(void) connection:(nsurlconnection *)connection didreceivedata:(nsdata *)data {     // each time connection downloads          // packet of data gets send here         // can [mydata appenddata:data]; }   - (void) connectiondidfinishloading:(nsurlconnection *)connection {         // connection has finished can          // want data here } 

that there it. nsurlconnection handles multithreading , don't have worry. can create activity indicator , display , work because main thread empty. :)


Comments

Popular posts from this blog

c# - Usage of Server Side Controls in MVC Frame work -

cocoa - Nesting arrays into NSDictionary object (Objective-C) -

ios - Very simple iPhone App crashes on UILabel settext -