ios - Load image into UICollectionVIewCell -


इमेज को छवि को सेट करने में समस्या UiCollectionViewCell

यह मेरा कोड है:

  - (UICollectionViewCell *) collectionView: (UICollectionView *) collectionView cellForItemAtIndexPath: (NSIndexPath *) indexPath {NSURL * imageUrl = [NSURL URLWithString: @ "https://mozorg.cdn.mozilla.net/media/img/firefox /firstrun/logo.png?2013-06 "]; एनएसडीटा * छविडेटा = [एनएसडीटा डेटाविथ कंटेंटऑफ ur: imageURL]; UIImage * image = [UIImage imageWithData: imageData]; UIImageView * myImageView = [[UIImageView alloc] initWithImage: छवि]; myImageView.image = [UIImage imageNamed: @ "myimg"]; // सेट छवि GLCell * सेल = (GLCell *) [collectionView dequeueReusableCellWithReuseIdentifier: CELL_IDENTIFIER forIndexPath: indexPath]; Cell.displayString = [NSString stringWithFormat: @ "% d उपयोगकर्ता संख्या", indexPath.row]; Cell.backgroundColor = [UIColor colorWithPatternImage: [UIImage imageNamed: @ "myimg"]]; रिटर्न सेल; }   

स्ट्रिंग मान समस्या के बिना दिखाता है, लेकिन सेल कोई छवि नहीं है।

 <कोड> NSURL * imageUrl = [NSURL URLWithString: @ "https://mozorg.cdn.mozilla.net/media/img/firefox/firstrun/logo.png?2013-06"]; एनएसडीटा * छविडेटा = [एनएसडीटा डेटाविथ कंटेंटऑफ ur: imageURL]; UIImage * image = [UIImage imageWithData: imageData]; GLCell * सेल = (GLCell *) [collectionView dequeueReusableCellWithReuseIdentifier: CELL_IDENTIFIER forIndexPath: indexPath]; Cell.displayString = [NSString stringWithFormat: @ "% d उपयोगकर्ता संख्या", indexPath.row]; Cell.backgroundColor = [UIColor colorWithPatternImage: image]];    

Comments

Popular posts from this blog

c - Mpirun hangs when mpi send and recieve is put in a loop -

python - Apply coupon to a customer's subscription based on non-stripe related actions on the site -

java - Unable to get JDBC connection in Spring application to MySQL -