Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7571801
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T15:45:35+00:00 2026-05-30T15:45:35+00:00

Im trying to implement your implementation to my project as a button called ‘Gallery

  • 0

Im trying to implement your implementation to my project as a button called ‘Gallery” but receive an error when trying to run the project.

My implementation file looks like this.

-(IBAction) gallery{


  NSMutableArray *photos = [[NSMutableArray alloc] init];

MWPhoto *photo;

{

    photo = [MWPhoto photoWithFilePath:[[NSBundle mainBundle] pathForResource:@"fans1" ofType:@"jpg"]];

    photo.caption = @"My fans 1";

    [photos addObject:photo];

    photo = [MWPhoto photoWithFilePath:[[NSBundle mainBundle] pathForResource:@"fans2" ofType:@"jpg"]];

    photo.caption = @"My fans 2";

    [photos addObject:photo];

    photo = [MWPhoto photoWithFilePath:[[NSBundle mainBundle] pathForResource:@"fans3" ofType:@"jpg"]];

    photo.caption = @"Fans3";

    [photos addObject:photo];

    photo = [MWPhoto photoWithFilePath:[[NSBundle mainBundle] pathForResource:@"fans4" ofType:@"jpg"]];

    photo.caption = @"Fans4";

    [photos addObject:photo];


}






  self.photos = photos;



     // Create browser

  MWPhotoBrowser *browser = [[MWPhotoBrowser alloc] initWithDelegate:self];

browser.displayActionButton = YES;

  //browser.wantsFullScreenLayout = NO;

  //[browser setInitialPageIndex:2];



  // Show

  if (_segmentedControl.selectedSegmentIndex == 0) {

// Push

[self.navigationController pushViewController:browser animated:YES];

  } else {

// Modal

UINavigationController *nc = [[UINavigationController alloc]              initWithRootViewController:browser];

   nc.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;

[self presentModalViewController:nc animated:YES];

   }

  }

  #pragma mark - MWPhotoBrowserDelegate

  - (NSUInteger)numberOfPhotosInPhotoBrowser:(MWPhotoBrowser *)photoBrowser {

   return _photos.count;

     }



  - (MWPhoto *)photoBrowser:(MWPhotoBrowser *)photoBrowser photoAtIndex:   (NSUInteger)index {

      if (index < _photos.count)

       return [_photos objectAtIndex:index];

   return nil;

  }

When I run the project but the image gallery is not displayed. Im fairly new to ioS development.If you can please point me in the right direction i will deeply appreciate it. The main goal is to have the image gallery displayed when the user touches the Gallery button.

I copied and edited the code from the MWPhotoBrowser Demo Project File I don’t receive any errors but I can’t get the gallery to appear once button is touched. (BTW I assigned the IBACTION to the buttons). If there is another source code or alternative Framework I can use please advise. Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T15:45:36+00:00Added an answer on May 30, 2026 at 3:45 pm

    Some Ideas:

    1) try using ‘initWithPhotos’.

    2) put a breakpoint at the place you are pushing, check that the push is called.

    3) check that the navigationController is not null (0x0) in debugging.

    4) remember to release ‘browser’.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Am trying to implement a generic way for reading sections from a config file.
While trying to implement an MVC file upload example on Scott Hanselman's blog. I
im trying to implement a custom error page, what i want to be able
I am trying to implement jQuery with PrimeFaces and JSF components, but it's not
I'm trying to implement a Facebook like button within an iframe of a constrained
I'm trying to implement the levenshtein distance (or edit distance) in Haskell, but its
really need your help with log-in-with-facebook feature I'm trying to implement on my website.
Hello and thanks for your time! While trying to implement the Form Wizard I
I trying to implement a memoized_finder method and I am getting an error that
All I am currently trying implement something along the lines of dim l_stuff as

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.