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 8907265
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T02:52:15+00:00 2026-06-15T02:52:15+00:00

I’m trying to make a app that uses a photobrowser Decided to go with

  • 0

I’m trying to make a app that uses a photobrowser
Decided to go with the MWPhotoBrowser.

This is the code, but i cant seem to make it work:

ViewController.h

#import <UIKit/UIKit.h>
#import "MWPhotoBrowser.h"

@interface ViewController : UIViewController<MWPhotoBrowserDelegate> {
    NSArray *_photos;
    UISegmentedControl *_segmentedControl;
}
@property (nonatomic, retain) NSArray *photos;
- (IBAction)billede:(id)sender;

@end

ViewController.m

#import "ViewController.h"

@interface ViewController ()

@end

@implementation ViewController
@synthesize photos = _photos;


- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        UIBarButtonItem *item = [[[UIBarButtonItem alloc] initWithCustomView:_segmentedControl] autorelease];
        self.navigationItem.rightBarButtonItem = item;
        self.navigationItem.backBarButtonItem = [[[UIBarButtonItem alloc] initWithTitle:@"Back" style:UIBarButtonItemStyleBordered target:nil action:nil] autorelease];
    }
    return self;
}


- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
- (IBAction)billede:(id)sender {

    //show your photo whit url
    NSMutableArray *photos = [[NSMutableArray alloc] init];
    MWPhoto *photo;
    {
    photo = [MWPhoto photoWithFilePath:[[NSBundle mainBundle] pathForResource:@"photo2l" ofType:@"jpg"]];
    photo.caption = @"The London Eye is a giant Ferris wheel situated on the banks of the River Thames, in London, England.";
    [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];
        [nc release];
    }



}


#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;

}

@end

I’ve tried both with ARC and wothout ARC

Without ARC i get 3 errors:

Undefined symbols for architecture i386:
“_OBJC_CLASS_$_MWPhoto”, referenced from:
objc-class-ref in ViewController.o
“_OBJC_CLASS_$_MWPhotoBrowser”, referenced from:
objc-class-ref in ViewController.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

With ARC i get 2 errors

Problem 1
https://i.stack.imgur.com/KuxrJ.png

Problem 2
https://i.stack.imgur.com/KsWXQ.png

I’ve not done it here, but i would like it alle to be wrapped in a button so i can click that and show a image inside the MWPhotoBrowser

Edit

I have upgraded my code, removed ARC from my files and i have now set the target right.
It will compile now, but everytime i triy to click the button: “billede” i get:

    2012-11-26 23:32:10.955 MWPhotoBrowserTest[10405:c07] -[ViewController galleri:]: unrecognized selector sent to instance 0x947fb20
2012-11-26 23:32:10.957 MWPhotoBrowserTest[10405:c07] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[ViewController galleri:]: unrecognized selector sent to instance 0x947fb20'
*** First throw call stack:
(0x1d34012 0x14e9e7e 0x1dbf4bd 0x1d23bbc 0x1d2394e 0x14fd705 0x434920 0x4348b8 0x4f5671 0x4f5bcf 0x4f4d38 0x46433f 0x464552 0x4423aa 0x433cf8 0x1f6ddf9 0x1f6dad0 0x1ca9bf5 0x1ca9962 0x1cdabb6 0x1cd9f44 0x1cd9e1b 0x1f6c7e3 0x1f6c668 0x43165c 0x1e2d 0x1d55)
libc++abi.dylib: terminate called throwing an exception
(lldb) 
  • 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-06-15T02:52:17+00:00Added an answer on June 15, 2026 at 2:52 am

    Actually resolved this.
    I’ve struggled for 4 days and finally got it.
    I read through https://github.com/mwaterfall/MWPhotoBrowser#method-1-static-library and understood it, finally but i had a problem with User header Search Path.
    I finally got it, importet MWPhotoBrowser folder into my MWPhotoBrowser”project” folder and then sat User Header Search Path to “..” instead of “../” since “../” gave me “../../“

    Hope this helps anyone who might stand in the same problem as me!

    Btw, thanks for the help guys! 🙂

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

Sidebar

Related Questions

I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have this code to decode numeric html entities to the UTF8 equivalent character.
I have a French site that I want to parse, but am running into
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
This could be a duplicate question, but I have no idea what search terms
I know there's a lot of other questions out there that deal with this
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
I'm trying to create an if statement in PHP that prevents a single post
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am trying to understand how to use SyndicationItem to display feed which is

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.