2012-06-02 25 views
5

मैं गेमकिट का उपयोग कर वाईफ़ाई पर दो डिवाइसों के बीच कनेक्शन बनाना चाहता हूं। एप्पल के प्रलेखन का कहना हैGamekit के साथ काम करते समय वाईफाई पर कनेक्शन कैसे बनाएं?

एक इंटरनेट कनेक्शन चुन लिया जाता है, तो आपके आवेदन सहकर्मी पिकर संवाद को खारिज करने और अपने स्वयं के यूजर इंटरफेस पेश कनेक्शन पूरा करने के लिए आवश्यक है।

यह मैं अपने इंटरफेस प्रस्तुत किया है मैं क्या

- (void)peerPickerController:(GKPeerPickerController *)picker didSelectConnectionType:(GKPeerPickerConnectionType)type 
{ 
if (type == GKPeerPickerConnectionTypeOnline) 
{ 
    picker.delegate = nil; 
    [picker dismiss]; 
    [picker autorelease]; 

    [alert setTitle:@"\n\n\n"]; 
    [alert setMessage:@"Looking for other iPads, iPhones or iPod touches..."]; 
    [alert addButtonWithTitle:@"Cancel"]; 

    UIActivityIndicatorView *progress = [[UIActivityIndicatorView alloc] initWithFrame:CGRectMake(125, 50, 30, 30)]; 
    progress.activityIndicatorViewStyle = UIActivityIndicatorViewStyleWhiteLarge; 
    [alert addSubview:progress]; 
    [progress startAnimating]; 
    [alert show]; 
} 
} 

ठीक करना है। और अगला क्या है? मैं कैसे कनेक्ट करूं? सहकर्मियों की तलाश कैसे शुरू करें?

उत्तर

2

यह tutorial GameKit और या तो ब्लूटूथ या वाईफाई का उपयोग कर सहकर्मी कार्ड खेल के लिए सहकर्मी बनाता है। (लिंक अपडेट किया गया)

+1

लिंक गलत है - यह ट्यूटोरियल के लिए ADVERT पर जाता है। वास्तविक ट्यूटोरियल यहां है: http://www.raywenderlich.com/12735/how-to-make-a-simple-playing-card-game-with-multiplayer-and-bluetooth-part-1 – Adam