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.

iOS: How to get a proper Month name from a number? -


i know nsdateformatter suite of functionality boon mankind, @ same time confusing me. hope can me out.

somewhere in code, there int representing month. so: 1 january, 2 february, etc.

in user interface, display integer proper month name. moreover, should adhere locale of device.

thank insights

in mean time, have done following:

int monthnumber = 11 nsstring * datestring = [nsstring stringwithformat: @"%d", monthnumber];  nsdateformatter* dateformatter = [[nsdateformatter alloc] init]; [dateformatter setdateformat:@"mm"]; nsdate* mydate = [dateformatter datefromstring:datestring]; [dateformatter release];  nsdateformatter *formatter = [[nsdateformatter alloc] init]; [formatter setdateformat:@"mmmm"]; nsstring *stringfromdate = [formatter stringfromdate:mydate]; [formatter release]; 

is way it? seems bit wordy.

another option use monthsymbols method:

int monthnumber = 11;   //november nsdateformatter *df = [[[nsdateformatter alloc] init] autorelease]; nsstring *monthname = [[df monthsymbols] objectatindex:(monthnumber-1)]; 

note you'll need subtract 1 1..12 monthnumber since monthsymbols zero-based.


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 -