Weather app source 1 Yahoo Weather RSS Feed












- Slides: 12
Weather app source 분석
특징 1. Yahoo! Weather RSS Feed 사용 2. zip Code를 이용하여 검색 -> WOEID (Where on Earth Identifier)를 사용하여 검색하는 방법도 있다. 3. Web. View를 통해 web의 data를 가공하지 않고 application content에 적용시켰다.
Weather app 현재시간 Current Conditions: 상태, 온도 Forecast: 금일 날씨 내일 날씨 Zip Code
Weather app Weather - url 접근구현 Main View - 앞 화면구현 Flipside View -뒷 화면구현 (구현되지 않음) Application Controllers - Main (초기화) Flipside. View. xib Main. Window. xib
Weather app *** Main. View. xib Main View 인터페이스 UIWeb. View UIText. Field UIButton 인스턴스로 구성됨 UIWeb. View는 웹에 있는 content를 어플리케이션에 embed 할때 사용 한다. UIText. Field는 zip Code를 입력 받기 위해 만들어졌다.
Weather app 메소드 안의 로직부분의 설명은 소스에 주석 표시를 하였음 *** Amuck. Weather. h Property 없음 Methods //해당하는 Zip. Code의 날씨 xml를 가져온다. +(NSString*)get. Weather. Xml. For. Zip. Code: (NSString*)zip. Code;
Weather app *** Mainview. h – 파일 생성 그대로 되어있음 Property 없음 Methods 없음 *** Mainview. Controller. h Property //옛날 방식의 코딩법 - 최근에는 변수와 IBOutlet 선언을 따로 따로 한다. //ex) UIWeb. View *web. View; //@property (nonatomic) IBOutlet UIWeb. View *web. View; IBOutlet UIText. Field *text. Field; Methods //Amuck. Weather class의 get. Weather. Xml. For. Zip. Code 메소드를 통해 가져온 URL의 결 과값을 web. View를 통해 어플리케이션에 담는다. - (IBAction)go. Click;
Weather app Flipside View 폴더의 클래스들은 생성기본 클래스 Flipside의 인터페이스의 구현 로직 은 Root. View. Controller 클래스에서 이루어졌다. *** Flipside. View. h Property 없음 Methods 없음 *** Flipside. View. Controller. h Property 없음 Methods 없음
Weather app *** Root. View. Controller. h Property IBOutlet UIButton *info. Button; //Main. View. Controller class 객체 변수 Main. View. Controller *main. View. Controller; //Flipside. View. Controller class 객체 변수 Flipside. View. Controller *flipside. View. Controller; UINavigation. Bar *flipside. Navigation. Bar; Methods //info button의 action //main. View 에서 flipside. View 로 전환될 때 세팅 - (IBAction)toggle. View;
Weather app *** Zip. Weather. App. Delegate. h – 파일생성 그대로 되어있음 Property IBOutlet UIWindow *window; //Root. View. Controller class 객체 변수 IBOutlet Root. View. Controller *root. View. Controller; Methods 없음












