Précédent   Forum du club des développeurs et IT Pro > Systèmes > Mac > Objective-C
Objective-C Forum d'entraide sur le langage de programmation Objective-C
Partagez cette discussion sur d'autres réseaux sociaux : Viadeo Twitter Google Facebook Digg Delicious MySpace Yahoo
Réponse
 
Outils de la discussion
Publicité
'
Vieux 10/10/2012, 09h41   #1
ajacss
Invité de passage
 
Homme Arthur
Étudiant
Inscription : octobre 2012
Messages : 2
Détails du profil
Informations personnelles :
Nom : Homme Arthur
Localisation : France

Informations professionnelles :
Activité : Étudiant
Secteur : High Tech - Éditeur de logiciels

Informations forums :
Inscription : octobre 2012
Messages : 2
Points : 0
Points : 0
Par défaut Probleme compilation

Bonjour,
Voila je suis un débutant en développement IOS (pour ipad). Je sais que cette question va être très simple à résoudre pour une personne qui s'y connait un minimum ^^'.

J'ai une erreur au niveau de la compilation de mon projet, est ce que quelqu'un pourrait m'aider à la résoudre en m'expliquant ou ca bloque ?

Voici le .h:
Code :
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#import <UIKit/UIKit.h>
#import <Foundation/Foundation.h>
#import "Reachability/Classes/Reachability.h"

@interface Connexioncontroller: UIViewController
{
    Reachability *reachability;
}

@property(nonatomic,retain) UIWebView *Reachability;

- (void) handleNetworkChange:(NSNotification *)notice;

@end
Voici le .m:
Code :
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#import "Connexioncontroller.h"

@implementation Connexioncontroller
@synthesize Reachability;

- (void)viewDidLoad
{
    [super viewDidLoad];
    [[NSNotificationCenter defaultCenter] addObserver:self selector:[self handleNetworkChange] name:kReachabilityChangedNotification object:nil];
//error: No visible @interface for 'connexioncontroller' declares the selector 'handleNetworkchange'

    reachability = [Reachability reachabilityForInternetConnection];
    [reachability startNotifier];
    NetworkStatus remoteHostStatus = [reachability currentReachabilityStatus];
    
    if(remoteHostStatus == NotReachable)
    {
        NSLog(@"no");
    }
    else if (remoteHostStatus == ReachableViaWiFi)
    {
        NSLog(@"wifi");
    }
    else if (remoteHostStatus == ReachableViaWWAN)
    {
        NSLog(@"cell");
    }
}

- (void)viewDidUnload
{
    [super viewDidUnload];
    // Release any retained subviews of the main view.
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    return YES;
}

- (void) handleNetworkChange:(NSNotification *)notice
{
    NetworkStatus remoteHostStatus = [reachability currentReachabilityStatus];
    if(remoteHostStatus == NotReachable)
    {
        NSLog(@"no");
    }
    else if (remoteHostStatus == ReachableViaWiFi)
    {
        NSLog(@"wifi");
    }
    else if (remoteHostStatus == ReachableViaWWAN)
    {
        NSLog(@"cell");
    }
}

@end
Je suis debutant soyez indulgent.

Merci d'avance.
ajacss est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 10/10/2012, 15h17   #2
NameX
Membre actif
 
Inscription : décembre 2008
Messages : 277
Détails du profil
Informations forums :
Inscription : décembre 2008
Messages : 277
Points : 195
Points : 195
Bonjour,

essai :
@selector(handleNetworkChange à la place de : [self handleNetworkChange]

Bonne journée,

__________________
Paye Tes Dettes - Applciation android.

DevHackSecure - Pense bête d'un étudiant en informatique - Tutos DEV

" I also realize that _everybody_ thinks that they are right, and that they are supported by all other right-thinking people. That's just how people work. We all think we're better than average." Linus Torvalds
NameX est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 10/10/2012, 16h22   #3
ajacss
Invité de passage
 
Homme Arthur
Étudiant
Inscription : octobre 2012
Messages : 2
Détails du profil
Informations personnelles :
Nom : Homme Arthur
Localisation : France

Informations professionnelles :
Activité : Étudiant
Secteur : High Tech - Éditeur de logiciels

Informations forums :
Inscription : octobre 2012
Messages : 2
Points : 0
Points : 0
Oui en effet j'avais trouvé la solution Merci quand même

Mais je sais pas pourquoi maintenant j'ai des erreurs dans les classes de Reachability (que j'ai téléchargés du site d'apple et importés dans mon projet):

Petite capture:
http://image.noelshack.com/fichiers/...a-16-02-03.png

PS: Euh dois je importer aussi le ReachabilityAppDelegate.m (et le ReachabilityAppDelegate.h) ?
ajacss est déconnecté   Envoyer un message privé Réponse avec citation 00
Réponse
Outils de la discussion

Navigation rapide


Fuseau horaire GMT +2. Il est actuellement 19h59.


 
 
 
 
Partenaires

Hébergement Web