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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T09:03:44+00:00 2026-06-11T09:03:44+00:00

Here is my scenario: Main VC : Scroll View : [Multiple] MyPage : [Multiple]

  • 0

Here is my scenario:

Main VC : Scroll View : [Multiple] MyPage : [Multiple] ObjectView : [Multple] UIButton

I have my main view controller containing a UIScrollView. The Scroll view is supposed to load multiple “MyPage” Views with pagingEnabled. I use the IB to create the “MyPage” interface (MyPage.xib) and view controller files (MyPage.h &.m). MyPage.xib file owner is set to MyPage. This “MyPage” will again load multiple ObjectView which again I created through IB with (ObjectView.xib, ObjectView.h, ObjectView.m)

Both of the MyPage & ObjectView class are subclass of UIViewController which hold some of my data properties.

The ObjectView class have several buttons and I have those button Touch Up actions connected by control drag the button to my ObjectView.h.

In my Main VC’s viewDidLoad method, I have a loop that will add all the pages:

- (void)viewDidLoad {
  ...
  for (int i=0; i<numPages; i=i+1) {
    MyPage *spg =[[MyPage alloc]i init];
    ...definition of spg properties...
    [spg loadPage:i+1];
    [scrollView addSubview:spg.view];
  }
}

In the MyPage loadPage method, I have a loop that will add all the ObjectView

- (void) loadPage:(int) x {
  ...
  for (int i=0; i<numObjects; i++) {
    ObjectView *objvc = [[ObjectView alloc] init];
    ... defining objvc frame coordinates && other properties ...
    [self.view addSubview:objvc.view];
  }
}

In ObjectView, there are several buttons and I connect those buttons to TouchUp actions in IB through Ctrl-Drag the buttons to my ObjectView.h.

The App is successfully build, the scroll view did load, all pages and all objects are displayed nicely. However, when I touch the buttons the following run-time error appears:

Terminating app due to uncaught exception ‘NSInvalidArgumentException’, reason:

-[TitleLayouer touchBtnOnline:]: unrecognized selector sent to instance 0x17f810′

I try to put break point on my first statement in my button action method, however that break point cannot even be reached.

Hope someone can help me with this issue.

  • 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-11T09:03:45+00:00Added an answer on June 11, 2026 at 9:03 am

    I find out the problem and solution. The problem is due to ARC releasing the ObjectView and MyPage object when they are outside their scope (the loop?), so in run-time it cannot reference to the View Controller objects in memory anymore.

    The solution is to have a NSMutableArray property in the View Controller (and remember to alloc it with init, I once forgot about it and it causes another memory error…). Inside the loop, add the view controller objects (ObjectView/MyPage) to the array so these objects will be retained in the memory.

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

Sidebar

Related Questions

I am facing a scenario here. I have a main class which initializes a
Here's the scenario, I have a main.js file in abc.com which does $.post(index.php) to
Here's the scenario: Window creates a tab bar controller and adds multiple tab bar
Here is my scenario: I have a Main ParentWindow . Before opening the parent
Here is the scenario: I have a java main process, which uses JMS to
Here's the scenario. I have multiple processor threads reading a value. Only 1 thread
Here is my scenario: I have two MySQL tables: Categories (columns: id, category) Items
Here's the scenario: I have a public repo A . Bob forks A ,
Here's the scenario. When a user's login info is submitted, activityIndicator view is shown.
Here's the scenario I anticipate: I have an app written in PHP which has

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.