-(void) Viewwillappear: (BOOL) animated
{
[Iosexcept judgenetwork];//Networking
NSLog (@ "Check the network later ......");
Self.backImage.hidden = yes;//Hide background image
if (Ios.isdaymode = = 1)
{
[Self.backimage setimage:[uiimage imagenamed:@ "Back_day"];
}
Else
{
[Self.backimage setimage:[uiimage imagenamed:@ "Back_day"];
}
}
-(void) Viewdidappear: (BOOL) animated
{
=================================== Loading a custom tab bar from the nib ======================================
[[NSBundle Mainbundle] loadnibnamed:@ "Maincontroller" owner:self Options:nil];
Self.tabBarController.view.frame = CGRectMake (0, 20, 320, 460);
Check network if no network will pop up prompt
if (iosexcept.network = = 0)
{
Uialertview *alert = [[Uialertview alloc]initwithtitle:@ ' network status ' message:@ ' no network connection ' delegate:self Cancelbuttontitle:nil otherbuttontitles:@ "OK", nil];
[Alert show];
[Alert release];
}
Else
{
Load data on the Internet
If connected to the network recommended interface #define KDATARECOMMENDLISTURL [Nsurl urlwithstring:@ "http://iphonenew.ecartoon.net/book_list.php?type=4"]
Self.recommenddata = [NSData Datawithcontentsofurl:kdatarecommendlisturl];
Serial Update Interface # define KDATASERIALIZEUPDATELISTURL [Nsurl urlwithstring:@ "http://iphonenew.ecartoon.net/book_list.php?type=3"]
Self.serialdata = [Nsmutabledata Datawithcontentsofurl:kdataserializeupdatelisturl];
[Iosexcept parsehotwordsxmlwithobjecthotswordsarray];//Popular Vocabulary analysis
Self.welcomeActivity.hidden = YES;
[Self entermaincontroller];//into five modules
}
}
//{
reachability *r = [reachability reachabilitywithhostname:@ "www.apple.com"];
//
switch ([R Currentreachabilitystatus]) {
Case Notreachable:
NSLog (@ "no network");
Break
Case Reachableviawifi:
NSLog (@ "WiFi network");
Break
Case Reachableviawwan:
NSLog (@ "WAN network");
Break
Default
Break
// }
reachability Detecting Network status