Skip to content

Objective_c Menulist #43

Description

@Beakerboy

in Window.h menu_item was changed to void:

@Property (nonatomic, assign) void *menuList;

Should there be an Objective-C object we can pass here instead?

Option B: The Pure Objective-C Architecture (Recommended)
If you want to fully break the connection between your UI layers and raw C allocations, eliminate menu_item entirely from your view models.
Instead of storing a raw C array, convert selections instantly into your custom NethackMenuItem Objective-C wrapper class (which you already have defined inside your imports list) and store them inside an NSArray.

Modify Classes/Window.h to hold a high-level array:
@property (nonatomic, retain) NSArray<NethackMenuItem *> *selectedMenuItems;

Convert Data at the Boundary (winiphone.m):
When NetHack hands down a list of items inside a callback function, your version-specific window layer instantly loop-allocates your custom NethackMenuItem classes, loads the text/identifiers into them, and binds the object array to your window instance.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions